Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > defining macro ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 1093 of 1126
Post > Topic >>

defining macro parameters

by "Paul" <-@[EMAIL PROTECTED] > May 5, 2008 at 04:01 PM

I would like to define a list of parameters, and then pass them to a macro.
However, the compiler (gcc) only sees one parameter, rather than expanding

the definition.
Could anyone suggest a way of making this work (using the preprocessor)?

#define MyList  1,2,3,4

#define Sum(a,b,c,d) a+b+c+d

 x = Sum(MyList);
-- 
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
 -- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
 




 4 Posts in Topic:
defining macro parameters
"Paul" <-@[E  2008-05-05 16:01:48 
Re: defining macro parameters
Andre Poenitz <poenitz  2008-05-09 17:33:21 
Re: defining macro parameters
sheleztt <sheleztt@[EM  2008-05-13 01:06:24 
Re: defining macro parameters
"Chris Thomasson&quo  2008-05-15 11:00:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 0:38:47 CDT 2008.