Mir shany
Mir shany

Reputation: 1

how define handle object in c++/CLR

MyPractice ^shan=gcnew MyPractice (L"Shahnawaz Talpur");

This executes well but I want to first declare variable ^shan and the assign the value how it could be

Upvotes: 0

Views: 283

Answers (1)

user703016
user703016

Reputation: 37955

Use nullptr :

// Declare and assign null
MyPractice^ shan = nullptr;

// Later when you need :
shan = gcnew MyPractice(L"Shahnawaz Talpur");

Upvotes: 1

Related Questions