S
sinbad
hi, i have a program like this. at line 18 i want z() to be called
and at line 19 i want y() to be called. The following macro defn's
doesn't seem to work (they replace both y() and x() with z() and z
()),
what's the correct way for doing this.
1 #include <stdlib.h>
2
3 #define x() y()
4 #define y() z()
5
6 void y() {
7 int i = 0;
8 i++;
9 }
10
11 void z(){
12 int j = 0;
13 j++;
14 }
15
16 int main ()
17 {
18 y(); /* i want z() to be called here */
19 x(); /* i want y() to be called here */
20 return 0;
21 }
and at line 19 i want y() to be called. The following macro defn's
doesn't seem to work (they replace both y() and x() with z() and z
()),
what's the correct way for doing this.
1 #include <stdlib.h>
2
3 #define x() y()
4 #define y() z()
5
6 void y() {
7 int i = 0;
8 i++;
9 }
10
11 void z(){
12 int j = 0;
13 j++;
14 }
15
16 int main ()
17 {
18 y(); /* i want z() to be called here */
19 x(); /* i want y() to be called here */
20 return 0;
21 }