D
daniel
Hi!
Anyone may help, please?!..
The C/C++ compiler from Visual Studio 6.0 gives
me a very strange error: "floating point not loaded"
when i try to retrieve a float with scanf, in a pointer
to a float in a structure..
If I retrieve it first in a buffer (float, of course) there are
no more errors. I mean, any subsequent calls to other
'wrong' style float input, works after this kind of trick.
On some computers it works well, on other it throws
that error message.
Someone told me there is a compiler option that should
fix this. Anybody knows how to fix that?
=======
Details:
The problems occurs in this kind of situation:
#include <stdio.h>
struct person {
char name[20];
float salary;
};
void main() {
struct person p[2];
printf(" Give me the salary: ");
scanf("%f", &p[0].salary);
printf(" the salary is: %.2f \n\n", p[0].salary);
}
Anyone may help, please?!..
The C/C++ compiler from Visual Studio 6.0 gives
me a very strange error: "floating point not loaded"
when i try to retrieve a float with scanf, in a pointer
to a float in a structure..
If I retrieve it first in a buffer (float, of course) there are
no more errors. I mean, any subsequent calls to other
'wrong' style float input, works after this kind of trick.
On some computers it works well, on other it throws
that error message.
Someone told me there is a compiler option that should
fix this. Anybody knows how to fix that?
=======
Details:
The problems occurs in this kind of situation:
#include <stdio.h>
struct person {
char name[20];
float salary;
};
void main() {
struct person p[2];
printf(" Give me the salary: ");
scanf("%f", &p[0].salary);
printf(" the salary is: %.2f \n\n", p[0].salary);
}