06장_배열과%20포인터

Cpp 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: << *a << "\n"; cout << " a[1] => " << a[1] << " *a+1 => " << *a+1 << "\n"; cout << " a[1] => " << a[1] << " *(a+1)=> " << *(a+1) << "\n"; } - 20 - [실습하기 6-11] 포인터 형태로 배열의 원소 값 출력하기 IT COOKBOOK [예제 6-11] 6_12.cpp 01 #include<iostream.h> 02 void main() 03 { 04 int a[5] = {10,20,30,40,50}; 05 int i; 06 for(i=0;i<5;i++) 07 cout<<" a+i => "<<a+i <<" &a[i]=> "<<&a[i]<<"\n"; 08 09 for(i=0;i<5;i++) 10 cout<<" *(a+i) => "<<*(a + i)<<" a[i]=> "<<a[i]<<"\n"; 11 } - 21 - [실습하기 6-12] 배열과 포인터 변수의 관계 알아보기 [예제 6-12] 6_12.cpp 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 #include<iostream.h> void main() { int a[5] = {10,20,30,40,50}; int* p; p = a; cout << "\n *p =>" << *p; cout << "\t a[0]=>" << a[0]; cout << "\n *(p+1)=>" << *(p+1); cout << "\t a[1]=>" << a[1]; cout << "\n *(p+2)=>" <<...
View Full Document

This document was uploaded on 01/19/2014.

Ask a homework question - tutors are online