VS中CString与char型数组相互转换问题

版权声明:墨痕诉清风 https://blog.csdn.net/u012206617/article/details/84893602
1. char str[]="hello";
   CString cstr;
   cstr.Format(str);
 
2. char str[100];
   LPSTR p;
   CString cstr="hello";
   p=cstr.getbuffer();
   strcpy(str,p);

猜你喜欢

转载自blog.csdn.net/u012206617/article/details/84893602