#include <string> #include <iostream> #include<stdio.h> using namespace std; void main() { char *p = "hello world"; char **pp = &p; cout<<p<<endl; cout<<&p<<endl; cout<<&pp<<endl; cout<<*(&pp)<<endl; cout<<&(*pp)<<endl; int size = sizeof(&(*pp)); char buf[12] ={0}; strcpy(buf, (char*) *pp); //sprintf(buf, "%s", *pp); char *ptr = (char*) *pp; cout<<ptr<<endl; cout<<&ptr<<endl; return; }
Char** ptr 到Char*的转换
最新推荐文章于 2021-05-22 00:50:58 发布