If some one could look at this code and tell me where im going wrong

This is the error i get

Unable to start program D:\c++\object\Debug\object.exe
The system canot find the file specified.

object is the name of the project..

Here is my code...

Thank you

#include <iostream>
using namespace std;

class tiger
{
public:

//tiger attributes
char color;
int legs;
char speed;
int stripes;
char size;
char personality;
char gender;

//constructor
tiger()
{
color = 'orange';
legs = 4;
speed = 'fast';
stripes = 5;
size = 'big';
personality = 'mean';
gender = 'male';
}

//define methods

//color
void setColor(char pColor)
{
color = pColor;
}

char getColor()
{
return color;
}

//legs
void setLegs(int pLegs)
{
legs = pLegs;
}

int getLegs()
{
return legs;
}

//speed
void setSpeed(char pSpeed)
{
speed = pSpeed;
}

char getSpeed()
{
return speed;
}

//stripes
void setStripes(int pStripes)
{
stripes = pStripes;
}

int getStripes()
{
return stripes;
}

//size
void setSize(char pSize)
{
size = pSize;
}

char getSize()
{
return size;
}

//personality
void setPersonality(char pPersonality)
{
personality = pPersonality;
}

char getPersonality()
{
return personality;
}

//gender
void setGender(char pGender)
{
gender = pGender;
}

char getGender()
{
return gender;
}


};

class fish
{
public:

//define attributes
char size;
int fins;
char texture;
char depth;
char color;

//constructor
fish()
{
size = 'small';
fins = 3;
texture = 'rough';
depth = 'deep water';
color = 'orange';
}

//size
void setSize(char pSize)
{
size = pSize;
}

char getSize()
{
return size;
}

//fins
void setFins(int pFins)
{
fins = pFins;
}

int getFins()
{
return fins;
}

//texture
void setTexture(char pTexture)
{
texture = pTexture;
}

char getTexture()
{
return texture:
}

//depth
void setDepth(char pDepth)
{
depth = pDepth;
}

char getDepth()
{
return depth;
}

//color
void setColor(char pColor)
{
color = pColor;
}

char getColor()
{
return color;
}


};


int main()
{
tiger liger;
tiger larry;

fish nemo;
fish squish;

cout << "Liger the tiger is" << liger.getColor() << endl;
larry.setColor('dark orange');
cout << "Larry the tiger is" << larry.getColor() << endl;







return 0;
}
It can't find the *.exe file because your code won't compile.
i think char in declaration
there has to be some modication i am only doing for the char variable color .
but you should apply it for all the character variable .


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
using namespace std;

class tiger
{
public:

//tiger attributes
	char color[50];
	int legs;
	char speed[50];
	int stripes;
	char size[50];
	char personality[50];
	char gender[50];

	//constructor
	tiger()
	{
	strcpy(color , "orange");
	legs = 4;
	strcpy(speed ,"fast");
	stripes = 5;
	strcpy(size , "big");
	strcpy(personality ,"mean");
	strcpy(gender , "male");
}

//define methods

//color
void setColor(char* pColor)
{
	strcpy(color , pColor);
}

char* getColor()
{
return &color;
}

//legs
void setLegs(int pLegs)
{
legs = pLegs;
}

int getLegs()
{
return legs;
}
Topic archived. No new replies allowed.