-
can you tell me why2?
Code:
#include <stdio.h>
#include <malloc.h>
struct student
{
float score;
};
main()
{
struct student *p;
p=(struct student *)malloc(sizeof(struct student));
scanf("%f",&(p->score));
/* or instead of "scanf("%f",&(*p).score);" */
printf("%f\n",(*p).score);
}
why once i run the programme
It will display :
scanf : floating point formats not linked
Abnormal program termination
can you tell me why ???waiting............
-
1) Don't use malloc.h. Use stdlib.h.
2) Don't cast the return of malloc.
3) Your compiler apparently doesn't support floating point numbers. Get a new one.
Quzah.
-
-
I too, come across the same problem earlier, In some older compliers this problem may arise.
It can be overcome by intialising the Floating Point emulator in your code as:
extern void _floatconvert( );
#pragma extref _floatconvert
Thanx,Gobinath
-