Sending fewer parameters then arguments

This is a discussion on Sending fewer parameters then arguments within the C++ Programming forums, part of the General Programming Boards category; Hi, I want to write a function that takes in 3 arguments of type char*, but when I call this ...

  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
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,652
    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, 02:33 PM

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