Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Why is abstraction used?

1135


What is encapsulation in ict?

1117


What is a superclass in oop?

1217


Why do we use encapsulation in oops?

1083


Why is static class not inherited?

1149


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

4209


How do you achieve runtime polymorphism?

1091


can inline function declare in private part of class?

4495


What is persistence in oop?

1200


What is the difference between static polymorphism and dynamic polymorphism?

1133


What is the renewal class?

2814


Can we override main method?

1280


What is coupling in oop?

1082


How long to learn object oriented programming?

1140


What are the 4 pillars of oop?

1201