什么是gcnew? [英] What is gcnew?

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

问题描述

我偶然发现了这个code和我太自豪地去问作者是什么意思。

I stumbled across this code and am too proud to go and ask the author what it means.

Hashtable^ tempHash = gcnew Hashtable(iterators_);

IDictionaryEnumerator^ enumerator = tempHash->GetEnumerator();

什么是 gcnew ,是多么重要它使用简单的新的,而不是? (我也难倒插入符号,我问那个在这里

What is gcnew and how important is it to use that instead of simply new? (I'm also stumped by the caret; I asked about that over here.)

推荐答案

gcnew 是.NET参考对象;与gcnew创建的对象是自动垃圾回收;重要的是要使用gcnew与CLR类型

gcnew is for .NET reference objects; objects created with gcnew are automatically garbage-collected; it is important to use gcnew with CLR types

这篇关于什么是gcnew?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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