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 |
Why is encapsulation used?
What normal C constructs work differently in C++?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
whats the difference between c and c++
How to Increment the value of the empid E001 for each and every employee by using the programe?
What are the fields of vtable
What are the 3 principles of oop?
what is polymorpsim? what are its types?
What is inheritance in simple words?
Is data hiding and abstraction same?
Is react oop?
WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??
21 Answers Biocon, MIT, NIIT,