473,386 Members | 1,943 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,386 software developers and data experts.

Difficult Code ??!!

Please read this ( C++ .NET ) 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;

__gc class Animal

{

public:

int legs;

void SetName(String *name)

{ strName = strName->Copy(name); }

String* GetName() { return strName; }

private:

String *strName;

};

int _tmain()

{

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();

Console::WriteLine("Animal 2");

Console::Write("Name: ");

Console::WriteLine(dog->GetName());

Console::Write("Legs: ");

Console::WriteLine(dog->legs);

Console::WriteLine();

return 0;

}

The "stdafx.h" file contains: #include <iostream& #include <tchar.h>

++++++++++++++++++++++++++++++++++++++++++++

This code contains some old data. My "Visual Studio 2005 " progam could't
build it except after conversion into the old version.But I don't want this
because I want to know what is updated.

Now I want to let the compile accept it and compile it without conversion
to old version - How ? by doing some modifications. I did the following
changes as :

I deleted _gc , and _tmain and replaced the latter by" int main"

I found the errors decreased much except one only which tells to add "clr ".

Please can any person make successful changes in this code to be built good
without convesion? and tell me what's new project template he chose (
console. CLR\ empty CLR ....etc

Thank all.

============================================
Oct 23 '06 #1
0 903

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Spammay Blockay | last post by:
I've been tasked with doing technical interviews at my company, and I have generally ask a range of OO, Java, and "good programming technique" concepts. However, one of my favorite exercises I...
12
by: Mike Dee | last post by:
A very very basic UTF-8 question that's driving me nuts: If I have this in the beginning of my Python script in Linux: #!/usr/bin/env python # -*- coding: UTF-8 -*- should I - or should I...
5
by: Nick Keighley | last post by:
Hi, In the beginning the code was:- BRUSHH new_brush = create_brush() BRUSHH old_brush = select_brush (new_brush) draw(...) select_brush (old_brush) destroy_brush (new_brush)
5
by: Bob | last post by:
Hi Everybody Difficult question Has anyone else used the "Using the Tab control as a container" database example that comes with the above book chapter 7 on the accompanying disc. It is a...
8
by: shan | last post by:
I have tried writing a program which should 1)get a number from user 2)calculate the following for e.g if the input is 3 then 3 3 3 and the answer should be 19683. 3)similarly when the...
0
by: tom | last post by:
Hallo, I need help on MIDI file, and precisely about retrieving few note values (mainly the "Velocity" value, corrisponding to the intensity of a played note) while the MIDI is playing.
2
by: Eniac | last post by:
*argh* ... *pull hairs* I've recently started developing from ASP to ASP.NET The switch was fairly smooth since i had done some VB.net before ... then came...FORMS! :) I find it astounding...
12
by: RICHARD BROMBERG | last post by:
For the last couple of days I have been trying to learn how to solve this problem. I'm using Access 2000 I am posting it again and maybe I will be mofe successful. I have a text box and a...
14
AccessIdiot
by: AccessIdiot | last post by:
Hello all, A while ago I got a lot of help on building a bunch of forms tied to a somewhat complicated db. Now I'm back with a search form question. The guys that I built the db for - they...
2
TheServant
by: TheServant | last post by:
I have a difficult join situation which I am not quite sure on the SYNTAX or if it's even possible: $raw_alliance_info = mysql_query( "SELECT name, code, description, members, focus, bonus,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.