My question regards the purpose of this syntax, as it is new to me.
Information regarding this topic would be most helpful. (i.e. is it an example of a bitwise operator, an assignment related operator, or even - though unlikely - an exponential operator.)
Thank you.
Wait... is MSDN now trying to pass off C++/CLI as C++? O_o
Explanation: This isn't C++. In C++/CLI, Microsoft added the type^ syntax for creating garbage-collected pointers, named handles. In addition, they added gcnew to be used with handles in place of new.
That is very interesting. I will have to familiarize myself with CLI. Thank you for the information. The way by which I came across this was in exploring the various ways and means of File IO. The example of using the System::File class employed several garbage-collected pointers. I was required to enable Common Language Support to use it, along with
error C2039: 'File' : is not a member of 'System'
error C3622: 'System::IO::File': a class declared as 'abstract' cannot be instantiated
c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : see declaration of 'System::IO::File'
error C2512: 'System::IO::File' : no appropriate default constructor available
Do you have any input on the subject?
p.s. - I've also already added a reference to System in the project.
To get those errors to go away, all you have to do is get rid of this line:
System::File srcFile;
As the errors suggest, there is no "File" class in the System namespace. File is in the System::IO namespace. Also, System::IO::File is an abstract class (i.e. you cannot instantiate it. That is, you can't have a variable of type System::IO::File). It just has a bunch of static methods for creating FileStream objects (says MSDN).