How can we use the preprocessor #if and #elseif.
Answers were Sorted based on User's Feedback
Answer / som shekhar
Take the following example where i assume that table size
has been defined previosly but at some part of time i want
to change it..but the table size is defined in some other
module and you dont have an access to it.
#if TABLE_SIZE>200
#undef TABLE_SIZE
#define TABLE_SIZE 200
#elif TABLE_SIZE<50
#undef TABLE_SIZE
#define TABLE_SIZE 50
#else
#undef TABLE_SIZE
#define TABLE_SIZE 100
#endif
int table[TABLE_SIZE];
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / som shekhar
Take the following example where i assume that table size
has been defined previosly but at some part of time i want
to change it..but the table size is defined in some other
module and you dont have an access to it.
#if TABLE_SIZE>200
#undef TABLE_SIZE
#define TABLE_SIZE 200
#elif TABLE_SIZE<50
#undef TABLE_SIZE
#define TABLE_SIZE 50
#else
#undef TABLE_SIZE
#define TABLE_SIZE 100
#endif
int table[TABLE_SIZE];
| Is This Answer Correct ? | 0 Yes | 1 No |
what isthe difference between c structure and c++ class
What is encapsulation in simple terms?
how to find no of instances of an object in .NET?
Why do we use polymorphism in oops?
what is data abstraction with example.
20% of a 6 litre solution and 60% of 4 litre solution are mixed what the % of mixture of solution it is resulted into?
What is the difference between class and structure?
What is encapsulation with example?
tel me oops defination in single line
Iam doing my project on instant messaging , if you any new ideas regarding this project ,please suggest it?
How do you define a class in oop?
what is the size of an empty class