相关疑难解决方法(0)

在vc ++中将'System :: String ^'转换为'const char*'

如何在vc ++中将'System :: String ^'转换为'const char*'?

我的代码:

String ^Result1= "C:/Users/Dev/Desktop/imag.jpg";

IplImage *img1 = cvLoadImage(Result1, 1);

如果我喜欢上面它会产生以下错误.

error C2664: 'cvLoadImage' : cannot convert parameter 1 from 'System::String ^' to 'const char *'

请帮我.

string c++-cli char visual-c++

6
推荐指数
2
解决办法
2万
查看次数

如何将System :: String转换为const char*?

如何将'String ^'转换为'const char*'?

     String^ cr = ("netsh wlan set hostednetwork mode=allow ssid=" + this->txtSSID->Text + " key=" + this->txtPASS->Text);
system(cr);
Run Code Online (Sandbox Code Playgroud)

错误:

1   IntelliSense: argument of type "System::String ^" is incompatible with parameter of type "const char *"
Run Code Online (Sandbox Code Playgroud)

c++-cli

1
推荐指数
1
解决办法
2977
查看次数

标签 统计

c++-cli ×2

char ×1

string ×1

visual-c++ ×1