B
blacksoil
Hi,
I have a question regarding reading data from a file and put it to a
member of a class. I use fscanf.
The class looks like this
class myclass
{
double a;
...
}
Now in one of its member function, I want to do the following:
fscanf(fp,"%f\n",&myclass.a);
However, it turns out that myclass.a is not given the data.
I am not familiar with syntax in c++ and could anyone give me some
suggestions? Thanks a lot!
--Zhi
I have a question regarding reading data from a file and put it to a
member of a class. I use fscanf.
The class looks like this
class myclass
{
double a;
...
}
Now in one of its member function, I want to do the following:
fscanf(fp,"%f\n",&myclass.a);
However, it turns out that myclass.a is not given the data.
I am not familiar with syntax in c++ and could anyone give me some
suggestions? Thanks a lot!
--Zhi