Thread: storing printf statement in to string

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    3

    storing printf statement in to string

    fprintf(logtext,"\nCheck for SLIDING is not satisfied for combination number %d",case_stab[i]);


    I want to store above statement in string variable and will use this to add to my listbox in VC++.

    example--
    string1="Check for SLIDING is not satisfied for combination number 15"

    I dont know how to do this. I think above statement return int value. Your help in this matter will be highly appricitaed.

    Thanks
    Amit

  2. #2
    Watch for flying houses. Nessarose's Avatar
    Join Date
    Sep 2004
    Posts
    46
    sprintf() will write to a string: http://www-ccs.ucsd.edu/c/stdio.html#sprintf

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. segmentation fault upon reload
    By yabud in forum C Programming
    Replies: 8
    Last Post: 12-18-2006, 06:54 AM
  3. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  4. Very odd segmentation fault/core dump.
    By ChristianTool in forum C Programming
    Replies: 19
    Last Post: 04-26-2004, 06:38 AM
  5. Another overloading "<<" problem
    By alphaoide in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2003, 10:32 AM