传递给C+的C#字符串+;CLI 不知道我在S/O上寻找什么,我有一个C应用程序,它需要把值传递给C++ CLI应用程序(托管代码)。(我真的只需要找出字符串传递)

传递给C+的C#字符串+;CLI 不知道我在S/O上寻找什么,我有一个C应用程序,它需要把值传递给C++ CLI应用程序(托管代码)。(我真的只需要找出字符串传递),c#,c++-cli,C#,C++ Cli,我有 在C++中,希望得到字符串(双看起来很好) 我读到了以下内容 C++ --> std::wstring or in C++ --> extern "C" __declspec void GetString( char* buffer, int* bufferSize ); C# --> void GetString( StringBuilder buffer, ref int bufferSize ); 或许 System::String^ const char *

我有

在C++中,希望得到字符串(双看起来很好)

我读到了以下内容

C++ --> std::wstring
or in C++  -->  extern "C" __declspec void GetString( char* buffer, int* bufferSize );
C# --> void GetString( StringBuilder buffer, ref int bufferSize );
或许

System::String^
const char *

??所以我只想把C的字符串发送到C++ + CLI,虽然看起来很简单,但我没有在C++中接受训练,发现互操作/编组的例子看起来不那么微不足道。p> 如果您使用的是C++/CLI,则可以直接使用
String

void Highlight(double xCoordinate, double yCoordinate, String^ name)
{
    //...

我已经把这个问题推迟了,因为它似乎不适用于<代码> C++ >代码>或<代码>管理-C++ >代码>。所以在C++中,我会做空的高亮显示(双x坐标,双y坐标,string ^ name),然后在C中简单地把它保留下来?为什么字符串不明确?大写字符串属于C++ CLI中的命名空间?(我记得我查了一下,没有看到答案)哦,使用名称空间系统;(系统::字符串^)
void Highlight(double xCoordinate, double yCoordinate, String^ name)
{
    //...