Function parameters

Non-platform specific questions.

Function parameters

Postby DilloDude » Wed Apr 05, 2006 11:49 am

If i'm writing a function with parameters,
Code: Select all
void function(int param1, char *param2)
...
, how can I have it so it has two parameters, but you only enter 1? So if you enter a string, it will do one thing, but if you enter an integer, it will do another. Like in the sprintf function, you enter your strings and another variable, and it can be a string, a real or an integer variable.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Fuzzy » Wed Apr 05, 2006 12:14 pm

I think Printf does something special, taking a single argument and breaking it down internally.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest