codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <stdio.h> typedef struct { int a; int b; } S; #define F(a,b) ( v.a = a, v.b = b, v ) int main(void) { S s, v; s = ( v.a = 1, v.b = 2, v ); // this works as expected printf("s = { %d %d } \n", s.a, s.b); s = F(1, 2); // but gcc complains about the macro equivalent printf("s = { %d %d } \n", s.a, s.b); return 0; }
Private
[
?
]
Run code
Submit