c ++变量声明

c ++变量声明

问题描述:

<pre lang="midl">String^ name;<br />
String^ message;<br />
StringComparer^ stringComparer = StringComparer::OrdinalIgnoreCase;</pre><br />



^是什么意思?

谢谢:)


what does the "^" mean ?
thank you :)

基本上可以被垃圾收集器移动的指针

^浮动指针

%浮动引用
Basically a pointer that may be moved by the garbage collector
^ floating pointer
% floating reference


这不是C ++,这是托管C ++。如果你想用纯C ++编写代码,别忘了它。
This is not C++, this is managed C++. If you want to code in pure C++, forget about it.


String ^ name; 只是VC ++ .NET中特别使用的托管字符串,即可以在设置中提供/ clr时使用。它作为一个简单的字符串操作,除了它是一个指向字符串的指针或它被引用的对象。
String^ name; is nothing but managed string specially used in VC++.NET, i.e. can be used when "/clr" s provided in the settings. It is operated as a simple string except the fact that it is a pointer to string or the object that it is being referred to.