fprintf function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickyeng
    Contributor
    • Nov 2006
    • 252

    fprintf function

    i have this:
    Code:
    	fprintf(ptr, "$s ", title);
    which should print title into a file.

    is $ correct?
    i have it on my pdf file, maybe its printed wrongly, but i want to conform.
    should be "%s" or "$s" ? or both also can?

    never thought $ is works.

    anyone?
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    assuming ptr is FILE * and title is a char * it should be
    Code:
    	fprintf(ptr, "%s ", title);
    see
    http://www.cplusplus.c om/reference/clibrary/cstdio/fprintf.html

    Comment

    Working...