c++字符串指针地址的输出
时间:2014-01-21 17:16:21
收藏:0
阅读:482
|
1
2
3
4
5
6
7
8
9 |
#include <iostream>using
namespace
std;int
main(){ char
*p=NULL; p="computer"; cout<<p; return
0;} |
输出
computer
而不是字符串的地址,如果要输出地址
可以 用 printf("%p",p);
或
cout << static_cast<const void *>(p)
原文:http://www.cnblogs.com/newhcw/p/3527575.html
评论(0)