G
Guest
What is the scope of #define statement?
Say we have an inlude file as follows
---MyInclude1.h---
#ifndef MYINCLUDE1_H
#define MYINCLUDE1_H
#define EXAMPLE1 1000
#define EXAMPLE2 2000
#define EXAMPLE3 "Hello World"
#endif
---End of MyInclude1.h---
---MyInclude2.h---
#ifndef MYINCLUDE2_H
#define MYINCLUDE2_H
#define EXAMPLE1 "ABC"
#define EXAMPLE2 "DEF"
#define EXAMPLE3 3000
#endif
---End of MyInclude2.h---
If we include the MyInclude1.h and MyInclude2.h into my main program what
would be the value of EXAMPLE1,2,3 ?
Say we have an inlude file as follows
---MyInclude1.h---
#ifndef MYINCLUDE1_H
#define MYINCLUDE1_H
#define EXAMPLE1 1000
#define EXAMPLE2 2000
#define EXAMPLE3 "Hello World"
#endif
---End of MyInclude1.h---
---MyInclude2.h---
#ifndef MYINCLUDE2_H
#define MYINCLUDE2_H
#define EXAMPLE1 "ABC"
#define EXAMPLE2 "DEF"
#define EXAMPLE3 3000
#endif
---End of MyInclude2.h---
If we include the MyInclude1.h and MyInclude2.h into my main program what
would be the value of EXAMPLE1,2,3 ?