Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String VS 2013一直在说;“字符串”;未定义,i';I’我不确定这有什么问题_String_Namespaces_C++ Cli - Fatal编程技术网

String VS 2013一直在说;“字符串”;未定义,i';I’我不确定这有什么问题

String VS 2013一直在说;“字符串”;未定义,i';I’我不确定这有什么问题,string,namespaces,c++-cli,String,Namespaces,C++ Cli,我不确定字符串未定义是什么意思,我试着用谷歌搜索它,但结果只是关于字符串的随机信息 #include "MyForm.h" #include "String" using namespace System::Windows::Forms; [STAThread] int main(cli::array<String^>^ args) { Application::EnableVisualStyles(); Application::SetCompatibleTex

我不确定字符串未定义是什么意思,我试着用谷歌搜索它,但结果只是关于字符串的随机信息

#include "MyForm.h"
#include "String"

using namespace System::Windows::Forms;

[STAThread]
int main(cli::array<String^>^ args)
{
    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    Organizer1::MyForm form;
    Application::Run(%form);
}
#包括“MyForm.h”
#包括“字符串”
使用命名空间System::Windows::Forms;
[状态线程]
int main(cli::数组^args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Organizer1::MyForm;
应用程序::运行(%form);
}

字符串
在名称apce
系统中定义

所以要么写

using namespace System;
或者使用限定名

int main(cli::array<System::String^>^ args)
                    ^^^^^^^^^^^^
intmain(cli::数组^args)
^^^^^^^^^^^^

请尝试使用小写的
字符串。另外,如果您打算使用C++std字符串,您应该以
#include
的形式编写。您的意思是吗?谢谢,很抱歉之前没有接受,我的internet中断了一段时间,但这很有效!非常感谢您抽出时间。