ポインタを理解するのに助けが必要です:
基本的なポインタ:
int i = 3;
cout << i << endl; //prints 3
cout << &i << endl; //prints address of i
int * p = &i;
cout << p << endl; //prints the address p points to
cout << &p << endl; //prints the address of p
cout << *p << endl; //prints the value stored at the address p points to
今混乱:
char *buf = "12345";
cout << &buf[2] << endl; //prints 345
cout << buf+2 << endl; //prints 345
cout << *buf << endl; //prints 1
cout << *(buf+2) << endl; //prints 3
cout << buf << endl; //prints 12345
cout << &buf << endl; //prints 001CFA6C
buf [3]のアドレスを印刷するにはどうすればよいですか?