Re: Macros
- From: raxitsheth2000@xxxxxxxxxxx
- Date: 27 Nov 2006 23:36:34 -0800
1. will throw comile error,
why ?
2. macro will not add any '(' or ')' macro will blindly replace the
string.
x+2 * y- 10
= x + (2*Y) -10
=...do it urself
--raxit sheth
Harry wrote:
Hi all,Nice Day to you
I have a piece of code as
# define prod(a,b)=a*b
main()
{
int x=2;
int y=3;
printf("%d",prod(x+2,y-10));
}
will the macro be evaluated as (2+2)*(3-10)=4* -7 =-28.
I executed this code,but this o/p is not coming.
What is the reason?
Is it that expressions should not be passed as arguments to macro
functions...
can anyone help me out...
thanks in advance.
.
- References:
- Macros
- From: Harry
- Macros
- Prev by Date: Re: Sharing static variables or function between source files.
- Next by Date: [OT] Re: Reading a string of unknown size
- Previous by thread: Macros
- Next by thread: Re: Macros
- Index(es):
Relevant Pages
|
|