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 is virtual function?where and when is it used?
When a private constructer is being inherited from one class to another class and when the object is instantiated is the space reserved for this private variable in the memory??
How to reverse a sentence in c program ex: ram is a good boy answer: boy good a is ram
What is byval and byref? What are differences between them?
What is meant by oops concept?
There are 2 empty jars of 5 and 3 liters capacity. And a river is flowing besides. I want to measure 4 liters of wanter using these 2 jars. How do you do this?
Should you protect the global data in threads? Why or why not?
what is different between oops and c++
What are the main differences between procedure oriented languages and object oriented languages?
9 Answers IBM, Infosys, Wipro,
What is abstraction?
what is the difference between javap and jad utility
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?