User Profile

Collapse

Profile Sidebar

Collapse
codinginc
codinginc
Last Activity: Nov 19 '08, 10:29 AM
Joined: Sep 21 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • This what I get as an error message

    WARNING (251) Can't preprocess format to (s)printf

    using exact code mentioned on a previous thread.

    char specifier[] = "%f";
    char result[100];
    float fnum = 3.14159;

    sprintf( result,specifie r, fnum );

    I am using zilog c compiler. Maybe its just a compiler. I'll try another compiler just for comparison. (MSF...
    See more | Go to post

    Leave a comment:


  • Thanks for reply,
    I fixed code by changing char specifier to const char* specifier;
    however,
    sprintf(a,speci fier,b); will not compile because sprintf cannot parse specifier variable, it doesnt read the string value inside the specifier.
    I guess the only option is to modify the sprintf funtion itself....
    See more | Go to post

    Leave a comment:


  • codinginc
    started a topic Inserting format specifier from variable string value
    in C

    Inserting format specifier from variable string value

    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...
    See more | Go to post
No activity results to display
Show More
Working...