“(string ^ filename)"中的"hat"(^)是什么? [英] What is the "hat"(^) in: "(string^ filename)"?

查看:126
本文介绍了“(string ^ filename)"中的"hat"(^)是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到解释插入符号/帽子"/"^"符号的参考.有人可以给我链接吗?

ERandall

I can''t find a reference explaining the caret/"hat"/"^" symbol. Could someone please give me a link?

ERandall

推荐答案

这意味着它是对托管对象的引用,而不是指向非托管内存的指针.
看看MSDN: http://msdn.microsoft.com/zh-CN /library/yk97tc08(v=vs.80) [
It means it is a reference to a managed object, as opposed to a pointer to unmanaged memory.

Have a look at MSDN: http://msdn.microsoft.com/en-US/library/yk97tc08(v=vs.80)[^]


通过将此事物称为帽子",您看起来就像是看到数学文本中的积分符号并将其称为钩".尝试猜测它们并不是很有效,就像现在知道您要使用哪种计算机语言一样.我必须承认,负责某些术语混乱的一方是Microsoft.

请看我对这个问题的评论.您只需要学习不完全是C ++的这种语言即可.
参考?当然:

http://en.wikipedia.org/wiki/C%2B%2B/CLI [ ^ ],
http://www.gotw.ca/publications/C++CLIRationale.pdf [ ^ ],
http://www.ecma-international.org/publications/standards/Ecma-372.htm [^ ],
http://msdn.microsoft.com/en-us/library/3bstk3k5% 28v = vs.100%29 [ ^ ].


另请参阅我对OriginalGriff答案的评论.


字符"^"表示托管指针或参考符号. C ++/CLI具有其他.NET语言不具备的某些独特功能:引用被视为显式托管指针.在其他语言中,所有引用类型只能通过其引用来访问和操纵,这不会造成问题.使用C ++/CLI,可以通过由"^"表示的引用或通过非引用变量(不带"^")来操纵引用类型的对象.也就是说,C ++/CLI允许将值语义用于引用对象.请参阅上面引用的书/文章.

—SA
By calling this thing a "hat" you look like a person who sees the integral symbols in mathematical text and calls them "hooks". Trying to guess about them is not so productive, pretty much like now knowing which computer language you are looking at. I must admit that the party responsible for certain mess in terminology is Microsoft.

Please see my comment to the question. You just need to learn this language, which is not exactly the C++.
References? Sure:

http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.gotw.ca/publications/C++CLIRationale.pdf[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://msdn.microsoft.com/en-us/library/3bstk3k5%28v=vs.100%29[^].


Please also see my comment to the answer by OriginalGriff.


The character ''^'' denotes a managed pointer, or a reference sign. C++/CLI has some unique feature not available in other .NET languages: referenced are treated as explicit managed pointers. In other languages, all reference type are accessed and manipulated only via their references, which does not create problems. With C++/CLI, a reference-type object can be manipulated via the reference denoted by ''^'', or though the non-reference variable, without ''^''. That said, C++/CLI allows using of value semantic for reference objectс. Refer to the books/articles referenced above.

—SA


这篇关于“(string ^ filename)"中的"hat"(^)是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆