hi all,
i have created a class names members which looks like this..
class mymembers{
int data;
float dummy;
char* thename;
public :
mymembers()
{
cout<<"the value of i is "<<data;
data =12;
}
mymembers(int ic,char* name)
{
thename = name;
data= ic;
cout<<"hello this object's data value is "<<data<<endl;
}
mymembers(int ic,int it)
{
dummy = 12;
data= ic;
cout<<"hello this object's data value is "<<data<<endl;
}
};
in main i'm initializing an array of 3 objects
the code looks like this...
int main()
{
mymembers m[3] = {(20,22),(21,33),(45,44)};
getch();
}
and i get an error57 C:\Documents and Settings\abhishek\My Documents\check.cpp conversion from 'int' to non-scalar type 'mymembers' requested
and if i use one argument constructor to intialize the objects in the array then it shows no problem...so why its not taking the second argument correctly..which conversion it's talking abt...plz help!!!