How can we use the preprocessor #if and #elseif.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is polymorphism explain?

693


program for insertion ,deletion,sorting in double link list

2283


What is the main purpose of inheritance law?

672


What is difference between abstraction and encapsulation?

594


• What are the desirable attributes for memory managment?

1728






What is solid in oops?

613


What is property in oops?

569


is there any choice in opting subjects like 4 out of 7

1731


What are the features of oop?

641


Templates mean

1590


What is meant by multiple inheritance?

738


What is coupling in oop?

600


What are classes oop?

598


What is inheritance in simple words?

627


What is polymorphism what are the different types of polymorphism?

566