c++ 输出与指针

一:类型定义:

1. const signed char *;

2. const unsigned char *;

3. const char *;

4. void *.

二: 举例

char name[20]="hello world ! ";
char * pn="china";
cout<<"Hello!";
cout<<name;
cout<<pn;

三:获得地址

int eggs =12;
char *amount = "dozen";
cout<< &eggs;
cout<<amount;
cout<<(void *)amount;

 

 

posted @ 2012-05-02 00:20  open your eyes  阅读(349)  评论(0编辑  收藏  举报