Manipulating Args Passed to Variadic Functions

This is a discussion on Manipulating Args Passed to Variadic Functions within the C Programming forums, part of the General Programming Boards category; I have a c function declared as such: Code: logOut(unsigned char logLevel, char *msg, ...); I want to manipulate msg ...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    1

    Manipulating Args Passed to Variadic Functions

    I have a c function declared as such:
    Code:
    logOut(unsigned char logLevel, char *msg, ...);
    I want to manipulate msg and the variadic variables and then pass them into snprintf, but I don't know how to manipulate the variadic variables. I know how to get them with the VA_XXX macros, but then I don't know how to pass them to another variadic function (snprintf). Because there will be a different number of values each time I can't hard code anything. Does anyone know how to do this?

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Attaching functions to a class/struct
    By VirtualAce in forum Tech Board
    Replies: 2
    Last Post: 08-04-2003, 10:56 AM
  2. Functions taking ? # of args
    By JaWiB in forum C++ Programming
    Replies: 7
    Last Post: 06-04-2003, 10:23 PM
  3. Expression Manipulator v0.2 (bug fixes, functions)
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-26-2003, 04:52 PM
  4. Replies: 13
    Last Post: 02-09-2003, 03:52 PM
  5. API "Clean Up" Functions & delete Pointers :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-10-2002, 06:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21