Thread: Using "" within sprintf

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    62

    Using "" within sprintf

    I'm wanting to do the following

    sprintf (cmd, "command goes here "%s"",x);

    so cmd will equal:
    comand goes here "blah"

    I'm sure this is an easy one....thanks

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    63
    Quote Originally Posted by 3saul
    I'm wanting to do the following

    sprintf (cmd, "command goes here "%s"",x);

    so cmd will equal:
    comand goes here "blah"

    I'm sure this is an easy one....thanks
    Code:
    sprintf (cmd, "command goes here \"%s\"",x);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sprintf overflows my buffer -- why?
    By Lasston in forum C Programming
    Replies: 26
    Last Post: 06-20-2008, 04:33 PM
  2. sprintf : garbage appended
    By yeller in forum C Programming
    Replies: 9
    Last Post: 12-17-2007, 10:21 AM
  3. sprintf() giving crash to program!!
    By maven in forum C Programming
    Replies: 4
    Last Post: 01-01-2006, 12:26 PM
  4. sprintf and sscanf
    By tommy69 in forum C Programming
    Replies: 10
    Last Post: 04-22-2004, 08:00 PM
  5. Sprintf
    By Trauts in forum C++ Programming
    Replies: 10
    Last Post: 01-15-2003, 01:35 PM