Hi Everyone,
Is it possible to insert format specifier in a form of variable. See example below
Standard from
char result[100];
float fnum = 3.14159;
sprintf( result, "%f", fnum );
My question is
char specifier = "%f"; < - or specifier defined from input such as scanf(specifier)
char result[100];
float fnum = 3.14159;
sprintf( result,specifier, fnum );
I tried that way and it doesnt work. My question is, is it possible or not. If it is, whats the trick? Thanks.