View previous topic :: View next topic |
Author |
Message |
hayri Guest
|
using macros with multiple arguments! |
Posted: Wed Feb 02, 2005 2:29 pm |
|
|
i want to define a printfLCD macro to print formatted text on lcd.
basic code may like this!
#define printfLCD(format, values???????) printf(format, value1, value2, value3 ... )
the problem is how many arguments i will print is not known. (also argument types are not known)
printfLCD("%s" , mystring);
printfLCD("%s %u" , mystring, myint);
printfLCD("%u %u" , myint1, myint2);
etc...
is it possible? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Feb 02, 2005 2:53 pm |
|
|
You probably want to use just the printf() command. You can specify it like this
Code: | printf(LCD_PUTC, "n=%u",n);
|
Where LCD_PUTC is the function that writes the characters to the LCD. |
|
|
Guest
|
hayri |
Posted: Wed Feb 02, 2005 3:10 pm |
|
|
GREAT, GREAT, GREAT .... yes, i want this.
thanks a lot MARK. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|