首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

VS2005怎样把String^转为char*解决办法

2012-03-09 
VS2005怎样把String^转为char*在学习用VS2005,我想把RichTextBox的值赋给char*,但是不懂怎样转换,有知道的

VS2005怎样把String^转为char*
在学习用VS2005,我想把RichTextBox的值赋给char*,但是不懂怎样转换,有知道的说下,谢谢

[解决办法]

C/C++ code
String str;str.c_str()
[解决办法]
哦,2005
C/C++ code
String^ sSQL = "select * from container";IntPtr sptr = ::Marshal::StringToHGlobalAnsi(sSQL);void* stemp = sptr.ToPointer();char* szSQL = static_cast<char*>(stemp); 

热点排行