Pat*_*ist 1 c++ visual-studio-2008
我在Visual Studio 2008 Forms环境中尝试了这个简单的例子:
String^ textn;
textn = this->dateTimePicker1->Value.ToString();
textn = textn.substr(0, 7);
Run Code Online (Sandbox Code Playgroud)
这没有用神秘的消息编译:
1> type is 'System::String ^'
1> did you intend to use '->' instead?
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索了大约1个小时,现在找出它失败的原因,但我找不到答案.我通常编写C#代码,但由于工作中的情况我必须降级到C++,我发现做最简单的事情非常困难.
这不是很神秘.它告诉你该怎么做.使用->而不是.访问托管指针的成员:
textn = textn->substr(0, 7);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1578 次 |
| 最近记录: |