当前位置: 代码迷 >> VC >> vc++.net中字符串连接出错的有关问题
  详细解决方案

vc++.net中字符串连接出错的有关问题

热度:10175   发布时间:2013-02-25 00:00:00.0
vc++.net中字符串连接出错的问题
我用c++.net2005编写一段代码:
从名为text1文本框中取数据和一字符串连接
String   *ss;
ss=text1-> text+ "abcd ";
程序执行出错,提示不能有两个指针。
请问如何解决这个问题?谢了!

------解决方案--------------------------------------------------------
String *ss
改为 String^ ss;
------解决方案--------------------------------------------------------
String^ ss = gcnew String;
ss = String::Concat(text1-> text, "abcd ")
------解决方案--------------------------------------------------------
String::Format()也是一个不错的选择
------解决方案--------------------------------------------------------
String^ ss = text1-> text+ "abcd ";

------解决方案--------------------------------------------------------
String::Concat(S "adfdsf ",x.ToString(),y.ToString(),S "dfasdfas ");
  相关解决方案