hi !
I am currently reading the book "Microsoft Visual C++ .NET Step by Step - Version 2003 Julian Templeman and Andy " and the guy has used visual studio 2003 for all his excercies......
I am using Visual studio 2005 and the confusing part is that all the managed types he explains in visual studio 2003 fail in visual studio 2005 ..... the options are not the same also .....
for eg. he talks about giving prefixes to classes like _gcl or _value which decide the how the garbage collection will take place by the .NET framework ...... I tried that in Visual studio 2005 and it tells me that its old code.....
the guy tells to start a console appication but uses weired form here is a sample program :
Code:
// This is the main project file for VC++ application project
// generated using an Application Wizard.
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
// The Point structure definition
__value struct Point
{
public:
Point() { x = 0; y = 0; }
Point(int xVal, int yVal) { x = xVal; y = yVal; }
int x, y;
};
int _tmain()
{
// Create a Point
Point p1; // use the default constructor
Point p2(10,20); // use the second constructor to set x
// to 10 and y to 20
// Initialize its members
p1.x = 10;
p1.y = 20;
Console::Write(S"p1.x is ");
Console::WriteLine(p1.x);
return 0;
}
I get serious errors if I follow the managed C++ style .... what am I doing wrong or is this guy gone cuckoo ...... please help