Posted on 2003-11-18
I have the following code
char name ;
float salary ;
struct emp e ;
int i ;
printf ( "Enter the names and salaries of employees\n" ) ;
for ( i = 0 ; i <= 9 ; i++ )
scanf ( " %s %f", e[i].name , &e[i].salary ) ;
I don't have any compilation error.But when i try to execute the program & accept the floating point value, program crashes.I know that this is because of floating point emulator is not initialized and generally happens when we access the float member of the structure before any float variable.
How to initialize this.I am working on VC++ environment.