By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

'^' syntax in C++ under .NET Framework

P: n/a
I was going over MSDN to find a way to enumerate files using C++ under
the .NEt framework. I
came across some syntax that looks like:
DirectoryInfo^ di = gcnew DirectoryInfo("..\\GA\\Files");
array<FileInfo^>^fiArr = di->GetFiles();
Collections::IEnumerator^ myEnum = fiArr->GetEnumerator();
while ( myEnum->MoveNext() )
{
FileInfo^ fri = safe_cast<FileInfo^>(myEnum->Current);
Console::WriteLine( fri->Name );
}

My question is, what are all the "^" and if there is any documentation
anyone knows off so that I can read about it

regards,
Abhi

Jun 18 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ab************@gmail.com wrote:
I was going over MSDN to find a way to enumerate files using C++ under
the .NEt framework. I
came across some syntax that looks like:
DirectoryInfo^ di = gcnew DirectoryInfo("..\\GA\\Files");
array<FileInfo^>^fiArr = di->GetFiles();
Collections::IEnumerator^ myEnum = fiArr->GetEnumerator();
while ( myEnum->MoveNext() )
{
FileInfo^ fri = safe_cast<FileInfo^>(myEnum->Current);
Console::WriteLine( fri->Name );
}

My question is, what are all the "^" and if there is any documentation
anyone knows off so that I can read about it
I believe that's C++/CLI (or "Managed C++"). It's not C++. Microsoft
decided to confuse the entire programming world with their new names,
especially since they decided to drop the "/CLI" notation in most of
their documentation, which is in itself an outrage, AFAIAC. Please ask
in a microsoft.public.* newsgroup about the syntax of their language.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 18 '07 #2

P: n/a
I believe that's C++/CLI (or "Managed C++"). It's not C++.

You are correct. It's one of Microsoft's additions to C++.

If I remember well, '^' represents a managed pointer, but don't take
it for granted, my single contact with managed C++ was some year and
half ago and I hated it.

The syntax additions are described in the MSDN docs.

Jun 18 '07 #3

P: n/a
On Jun 19, 3:25 am, abhishekkar...@gmail.com wrote:
I was going over MSDN to find a way to enumerate files using C++ under
the .NEt framework. I
came across some syntax that looks like:
DirectoryInfo^ di = gcnew DirectoryInfo("..\\GA\\Files");
array<FileInfo^>^fiArr = di->GetFiles();
Collections::IEnumerator^ myEnum = fiArr->GetEnumerator();
while ( myEnum->MoveNext() )
{
FileInfo^ fri = safe_cast<FileInfo^>(myEnum->Current);
Console::WriteLine( fri->Name );
}

My question is, what are all the "^" and if there is any documentation
anyone knows off so that I can read about it

regards,
Abhi
Actually "^" is called handle. It's used to give handle (like pointer)
to the object in managed heap (garbage collected memory allocation).
It is used in context with gcnew(garbage collected new)
http://msdn2.microsoft.com/en-us/lib...08(VS.80).aspx

Surely this question is not supposed to deal with this forums. Please
contact any microsoft newsgroups for more info.

Regards,
Sarath
http://sarathc.wordpress.com/

Jun 19 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.