Float issues

i am adding two floating point numbers and i want to store in a character pointer...

float f1 ;
float f2 ;
char  *c = NULL;
printf\("Enter 2 floating numbers\\n"\);
scanf\("%f %f",&f1,&f2\);   

f1 = f1\+f2;
sprintf\(c, "%f", f1 \);

when i execute this, i am getting segmentation fault(core dump).
please help in this regards.

You can't assign a value to a pointer. First you have to allocate memory to store the value, something like:

char *c = malloc(32);

or:

char c[32];

Regards

can u send the complete program for the above said problem

There are a bunch of topics regarding C pointers on the net.
Google for "C" pointers.

Regards