Thread: sprintf replacement

  1. #1
    Unregistered
    Guest

    sprintf replacement

    I am trying to write myself a sprint replacement, but I am having trouble declaring multiple arguments.

    void sprintf(char* var, const char* format, ...);

    How exactly can I handle mutiple arguments? I know how to handle var and format but not the multiple argument list I am supposed to use.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Look up va_start, va_end, and va_arg.

    -Prelude
    My best code is written with the delete key.

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. NeHe Glaux replacement??
    By Razorblade Kiss in forum Game Programming
    Replies: 4
    Last Post: 02-25-2006, 03:30 AM
  3. sprintf Wrapping, a tough one
    By AdmiralKirk in forum C++ Programming
    Replies: 3
    Last Post: 02-03-2006, 10:43 AM
  4. sprintf() giving crash to program!!
    By maven in forum C Programming
    Replies: 4
    Last Post: 01-01-2006, 12:26 PM
  5. Sprintf
    By Trauts in forum C++ Programming
    Replies: 10
    Last Post: 01-15-2003, 01:35 PM