#include "stdafx.h"
#include <iostream>
using namespace std;
void fun (char **q)
{ cout < <(*q) < <endl; //这里的输出怎么会是hello zhouguochen呢?
//**q指向指针p的地址,可是我想不明白为什么这里会是这个输出?
//还有q怎么会是地址呢?麻烦解释一下原理,谢谢!
cout < <(q) < <endl;
}
void main()
{
char * p;
p="hello zhouguochen";
cout < <(p) < <endl;//这里怎么理解?我看过谭浩强的书了 上面有这样的定义,
//但是没解释原理,这里的输出为什么也是和上面(*q)一样呢
cout < <*(p+1) < <endl;
fun(&p);
} |