char* format=" "; // 16 spaces
char* Result[22] ;
int p=12;
sprintf(format, "%%.%df", p);
sprintf(Result, format, *d);
what is wrong with the above code?
it crashes on my PC, any help is appreciated.
I think the problem is with the variable format. You initialize it with a literal string. In Pelles C (and several other C compilers), literal strings are put in read-only memory. Writing to read-only memory will cause an exception.
Pelle