CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

using macros with multiple arguments!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hayri
Guest







using macros with multiple arguments!
PostPosted: Wed Feb 02, 2005 2:29 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Feb 02, 2005 2:53 pm     Reply with quote

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
PostPosted: Wed Feb 02, 2005 3:10 pm     Reply with quote

GREAT, GREAT, GREAT .... yes, i want this.

thanks a lot MARK.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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