Top Qs
Linha do tempo
Chat
Contexto
C++/CLI
linguagem de programação Da Wikipédia, a enciclopédia livre
Remove ads
C++/CLI (Common Language Infrastructure) é uma variante da linguagem C++ criada pela Microsoft em substituição às Managed C++ (MC++). C++/CLI está normalizada pela ECMA como ECMA-372. Atualmente está disponível em todas as edições do Visual Studio a partir do 2005 (também está incluído nas edições Express).
Remove ads
Diferenças entre Managed C++ e C++/CLI
// Managed extensions for C++
#using <mscorlib.dll>
using namespace System::Collections;
__gc class referencetype
{
protected:
String* stringVar;
int intArr __gc[];
ArrayList* doubleList;
public:
referencetype(String* str, int* pointer, int number) // Qual é managed???
{
doubleList = new ArrayList();
System::Console::WriteLine(str->Trim() + number.ToString());
}
};
// C++/CLI
// Com o VC++ 2005, a linha seguinte é desnecessária
// o compilador usa a DLL "mscorlib.dll" automaticamente
#using <mscorlib.dll>
using namespace System::Collections::Generic;
ref class referencetype
{
protected:
String^ stringVar;
array<int>^ intArr;
List<double>^ doubleList;
public:
referencetype(String^ str, int* pointer, int number) // Ambiguidade inexistente
{
doubleList = gcnew List<double>();
System::Console::WriteLine(str->Trim() + number);
}
};
Remove ads
Ligações externas
- ECMA 372: C++/CLI Language Specification (em inglês)
- MSDN documentação para C++/CLI (em inglês)
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads