2008년 04월 11일
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 감자1호
- namespace by 소심장이쩡
- c++음..call by reference by 소심장이쩡
- 열거체의 사용1 by 감자1호
- C++의 역사 ... by 소심장이쩡
# by | 2008/04/11 17:11 | C&C++정리 | 트랙백(6) | 덧글(1)





☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
제목 : Humans having sex with anima..
Porn sex with animals. Sex porn woman with farm animals. Sex with animals porn. Yourfilehost porn with animals....more
제목 : Xxx video on demand rocco s ..
Xxx video on demand rocco s animal trainer....more
제목 : Carisoprodol phentermine yel..
Carisoprodol use in dogs. Carisoprodol. Buy carisoprodol best prices limited time offer. Carisoprodol phentermine yellow. Carbamazepine carisoprodol pharmacy drugs....more
제목 : Cheap vicodin.
Buy vicodin without prescription. Vicodin online. Vicodin. Information about vicodin. Vicodin without prescription. Vicodin detox. Vicodin with no membership fees....more
제목 : Generic ambien.
Ambien sleeping pill. Ambien. Ambien and the menstrual cycle....more
제목 : Adderall xr side effects.
Adderall xr. Inject adderall. Adderall....more
char * b = a;
이건 애초에 안되여...