06장_배열과%20포인터

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

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

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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern