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 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better struts or spring?

612


Who invented oop?

644


What is difference between pop and oop?

597


write a programe to calculate the simple intrest and compund intrest using by function overlading

1659


What is oops?what is its use in software engineering?

553






how to get the oracle certification? send me the answer

1658


2. Give the different notations for the class.\

1582


What is polymorphism in oops?

554


Can a destructor be called directly?

591


What are the types of abstraction?

549


Please send ford technologies placement paper 2 my mail id

1646


What is the point of oop?

644


What is class in oop with example?

608


What are two types of polymorphism?

607


Why do pointers exist?

651