C&C++에서 변수,포인터변수,레퍼런스변수

#include <iostream>
using namespace std;

//요녀석은 int에서의
int main()
{
 int a = 10;
 int * b =&a;

 cout<<a<<endl;  //10
 cout<<&a<<endl; //a의 주소값
 cout<<&b<<endl; //b의 주소값
 cout<<*b<<endl; //10
 cout<<b<<endl;  //a의 주소값
  // cout<<**b<<endl; error
}

#include <iostream>
using namespace std;

//이녀석은 char 에서
int main()
{
 char a[] = "A";
 char  * b = a;

 cout<<a<<endl;  //A
 cout<<&a<<endl; //a의 주소값
 cout<<&b<<endl; //b의 주소값
 cout<<*b<<endl; //A
 cout<<b<<endl;  //A
 //cout<<**b<<endl;// error
}

//문자열에서
#include <iostream>
using namespace std;


int main()
{
 char a[] = "Abc";
 char  * b = a;

 cout<<a<<endl;  //Abc
 cout<<&a<<endl; //a의 주소값
 cout<<&b<<endl; //b의 주소값
 cout<<*b<<endl; //A
 cout<<b<<endl;  //Abc
 //cout<<**b<<endl;// error
}

이 글과 관련있는 글을 자동검색한 결과입니다 [?]

by 소심장이쩡 | 2008/04/11 17:11 | C&C++정리 | 트랙백(6) | 덧글(1)

트랙백 주소 : http://clearm81.egloos.com/tb/232272
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Tracked from Porn sex wit.. at 2008/07/30 13:09

제목 : Humans having sex with anima..
Porn sex with animals. Sex porn woman with farm animals. Sex with animals porn. Yourfilehost porn with animals....more

Tracked from Animal xxx b.. at 2008/08/01 15:45

제목 : Xxx video on demand rocco s ..
Xxx video on demand rocco s animal trainer....more

Tracked from Buy carisopr.. at 2008/08/03 17:43

제목 : Carisoprodol phentermine yel..
Carisoprodol use in dogs. Carisoprodol. Buy carisoprodol best prices limited time offer. Carisoprodol phentermine yellow. Carbamazepine carisoprodol pharmacy drugs....more

Tracked from How long doe.. at 2008/08/04 10:09

제목 : Cheap vicodin.
Buy vicodin without prescription. Vicodin online. Vicodin. Information about vicodin. Vicodin without prescription. Vicodin detox. Vicodin with no membership fees....more

Tracked from Ambien sleep.. at 2008/08/06 12:24

제목 : Generic ambien.
Ambien sleeping pill. Ambien. Ambien and the menstrual cycle....more

Tracked from Adderall tre.. at 2008/08/11 16:49

제목 : Adderall xr side effects.
Adderall xr. Inject adderall. Adderall....more

Commented by 소심장이쩡 at 2008/04/11 17:25
char a[2][10] = {"Abc","Def"};
char * b = a;

이건 애초에 안되여...

:         :

:

비공개 덧글

◀ 이전 페이지          다음 페이지 ▶