A
Aldi
Hi,
Thanks for the privious response on /clr option.
Now that I have included /clr option another problem jumps up, and my
books do not show anything about these problems:
compiler: MS.net: VC++7.0
project: elementary using console
The error I get is:
hello3 Command line error D2016 : '/RTC1' and '/clr' command-line
options are incompatible
TIA for any suggestion,
Aldi
Following is the program I am running:
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
__gc class animal
{
public:
animal(void);
virtual ~animal(void);
int legs;
void SetName(String *name)
{strName=strName->Copy(Name);}
String* GetName(){return strName;}
private:
String *strName;
};
int _tmain(int argc, _TCHAR* argv[])
{
Animal *cat, *dog ;
cat= new Animal;
dog= new Animal;
cat->SetName("Cat");
cat->legs=4;
dog->SetName("Dog");
dog->legs=4;
Console::WriteLine("Animal 1");
Console::Write("Name: ");
Console::WriteLine(Cat->GetName());
Console::Write("Legs: ");
Console::WriteLine(Cat->legs);
Console::WriteLine("Animal 2");
Console::Write("Name: ");
Console::WriteLine(Dog->GetName());
Console::Write("Legs: ");
Console::WriteLine(Dog->legs);
Console::WriteLine();
return 0;
}
Thanks for the privious response on /clr option.
Now that I have included /clr option another problem jumps up, and my
books do not show anything about these problems:
compiler: MS.net: VC++7.0
project: elementary using console
The error I get is:
hello3 Command line error D2016 : '/RTC1' and '/clr' command-line
options are incompatible
TIA for any suggestion,
Aldi
Following is the program I am running:
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
__gc class animal
{
public:
animal(void);
virtual ~animal(void);
int legs;
void SetName(String *name)
{strName=strName->Copy(Name);}
String* GetName(){return strName;}
private:
String *strName;
};
int _tmain(int argc, _TCHAR* argv[])
{
Animal *cat, *dog ;
cat= new Animal;
dog= new Animal;
cat->SetName("Cat");
cat->legs=4;
dog->SetName("Dog");
dog->legs=4;
Console::WriteLine("Animal 1");
Console::Write("Name: ");
Console::WriteLine(Cat->GetName());
Console::Write("Legs: ");
Console::WriteLine(Cat->legs);
Console::WriteLine("Animal 2");
Console::Write("Name: ");
Console::WriteLine(Dog->GetName());
Console::Write("Legs: ");
Console::WriteLine(Dog->legs);
Console::WriteLine();
return 0;
}