执行以下代码:
#include <IOSTREAM.H>
#include <STDIO.H>
#include <STRING.H>
void po(char *content);
void main()
{
<span style="white-space:pre"> </span>int a = 5;
<span style="white-space:pre"> </span>char b = 'a';
<span style="white-space:pre"> </span>int *p = &a;
<span style="white-space:pre"> </span>char *q = &b;
<span style="white-space:pre"> </span>char lpConetent[10] = "12345678";
<span style="white-space:pre"> </span>cout<<"p="<<p<<",*p="<<*p<<endl;
<span style="white-space:pre"> </span>cout<<"q="<<q<<",*q="<<*q<<endl;
<span style="white-space:pre"> </span>cout<<"lpConetent="<<lpConetent<<",*lpConetent="<<*lpConetent<<endl;
<span style="white-space:pre"> </span>printf("p=%d,*p=%d\n",p,*p);
<span style="white-space:pre"> </span>printf("q=%d,*q=%d\n",q,*q);
<span style="white-space:pre"> </span>printf("lpConetent=%s,*lpConetent=%c\n",lpConetent,*lpConetent);
<span style="white-space:pre"> </span>
}
运行结果是:(可以通过在cmd中执行该程序的exe文件来重定向改程序输出的内容到文件中,如在cmd中输入
E:\VC6.0\PrintPoint.exe>E:\VC6.0\PrintPoint.txt来)
p=0x0018FF44,*p=5
q=a烫?,*q=a
lpConetent=12345678,*lpConetent=1
p=1638212,*p=5
q=1638208,*q=97
lpConetent=12345678,*lpConetent=1