473,394 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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
3 1214
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
1
by: Sakesun Roykiattisak | last post by:
I have developed a framework to ease my database programming job, called "DescribedData Framework" which use inspection on function/method parameter-name to simplify my code. for example: ...
2
by: FDude | last post by:
Hello All. I have been doing a lot of .NET coding in VB.NET. I am very familiar with that language and have 2 books that already detail the .NET framework from a VB perspective. I want a C#...
4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
11
by: Mark Findlay | last post by:
Hello Experts! I am attempting to use the OleDbCommand.ExecuteScaler() function within my ASP.NET C# web page to perform a simple validation, but receive the following error: "Incorrect...
9
by: Bern McCarty | last post by:
I am porting stuff from MEC++ syntax to the new C++/CLI syntax. Something that we did in the old syntax that proved to be very valuable was to make sure that the finalizer would purposefully...
7
by: bryant | last post by:
Hi all. I am new to ASP and working in Expression Web. The following query displays the information I need in the gridview for a single record. SELECT "OE_HDR"."ORD_NO", "OE_HDR"."CUST_NAM",...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
8
by: KunalDesale | last post by:
Hi, I am using VB.NET and SQL Server 2005 for devlopement of one software. I am getting syntax error at run type only on live system. If try to recreate it on my machine with same data I don't get...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.