Original Post
ok when i compile my program i get the following errors
error C2440: ''='' : cannot convert from ''char [1]'' to ''char''
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2059: syntax error : '')''
my first error says i cant do this in my classes constructor
the second im not sure cause it just points to the for loop declaration but their is nothing wrong with it
cardata::cardata()
{
model[20]= "";
maker[30]= "";
year=0;
}
|
void cardata::scandata()
{
int x=0;
fin.open("data.dat", ios::in);
while ( !fin.eof())
{
for (x=0;x<20;x++)
fin>>maker[x];
for (x=0;x<30;++) //it points to here
fin>>model[x];
fin>>year;
}
fin.close();
}
|
Down with Tiberia!