Thread: Sending fewer parameters then arguments

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    17

    Sending fewer parameters then arguments

    Hi, I want to write a function that takes in 3 arguments of type char*, but when I call this function from other functions I only want to pass in 1 parameter.
    So below shows my function and I want its first argument to come from one function, the second to come from another function and the third from a different function.

    Code:
    void Output(char*, char*, char*) {
    
    }
    
    Output(Chat_room, ?, ?);
    
    
    Output( ?, user, ?);
    
    
    Output( ?, ?, Time);
    each call comes from other functions. Does anyone know how I can achieve this?

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Code:
    Output(GetChatRoom(), GetUser(), GetTime())
    maybe?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sending multiple arguments to function..
    By Zzaacchh in forum C++ Programming
    Replies: 3
    Last Post: 09-06-2008, 03:20 PM
  2. Parameters vs. Arguments
    By Sereby in forum C Programming
    Replies: 2
    Last Post: 07-27-2004, 10:00 AM
  3. sending arguments to function using CreateThread
    By Micko in forum C++ Programming
    Replies: 3
    Last Post: 07-15-2004, 07:07 PM
  4. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 10:48 AM
  5. Replies: 1
    Last Post: 02-06-2003, 03:33 PM