printf like function

This is a discussion on printf like function within the C Programming forums, part of the General Programming Boards category; Hello everyone. I need to create a function that receives a variable number of arguments in order to send them ...

  1. #1
    Registered User argon's Avatar
    Join Date
    Jan 2002
    Posts
    12

    Question printf like function

    Hello everyone.

    I need to create a function that receives a variable number of arguments in order to send them to the fprintf function itself.

    Further explanation:
    My function will receive an integer argument, followed by a printf-like list of arguments. It will then take the first argument, process it and call the fprintf function with the other arguments.

    I've read the documentation about the va_list and other functions defined in stdarg.h, but can't figure how or what will I pass to the fprintf function.

    Thanks for your help
    Greetings from México

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    >but can't figure how or what will I pass to the fprintf function.

    vfprintf? [EDIT] Like this? [/EDIT]
    Last edited by Dave_Sinkula; 10-07-2003 at 12:41 PM.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User argon's Avatar
    Join Date
    Jan 2002
    Posts
    12

    Talking

    Wow!! Thanks, works like a charm!!!
    Greetings from México

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 04:42 PM
  2. segmentation fault upon reload
    By yabud in forum C Programming
    Replies: 8
    Last Post: 12-18-2006, 05:54 AM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 12:03 PM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 10:00 AM

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