close
char[]轉成char*
參考網址:http://stackoverflow.com/questions/9627962/is-it-possible-to-convert-char-to-char-in-c
最簡單方法(wchar_t也適用)
method1:
char a[] = "hello";
char* p = &a[0];
method2:(避免method1的值一出scope就消失)
char a[] = "hello";
char* p;
p = strdup(a);
文章標籤
全站熱搜
留言列表