i have a program here and it wont work i think there is a problem in the array
Code:#include<stdio.h>
#include<conio.h>
#include<iostream>
#include<string.h>
using namespace std;
class Dog
{
int age,weight;
char color[11];
public:
void setValues(int, int, char[]);
int getAge(){return(age);}
int getWeight(){return(weight);}
char getcolor(){return(color[]);} // problem here am i returning this array right
void bark(){cout<< "woof!"<<endl;}
};
void Dog::setValues(int age, int weight, char color[])
{
this -> age = age;
this -> weight = weight;
strcpy(this -> color,color);
};
main()
{
Dog fido, pooch;
fido.setValues(3,15,"brown");
pooch.setValues(4,18,"gray");
cout<<"pooch is a" << pooch.getAge()<<endl;
cout<<"year old " << pooch.getcolor()<<endl;
cout<<"dog who weighs" << pooch.getWeight()<<endl;
cout<<"pounds";
pooch.bark();
getch();
}