What are Preprocessor Directives ?

October 28, 2007 · Filed Under C++ Questions, Placement Questions

Interview Questions » C++
What are Preprocessor Directives ?
The preprocessor directives are instructions to the compiler. All these preprocessor lines begin with a pound (#). They are executed before the compilation of the code begins. These directives can only span a single line and does not need to end in a semicolon.
The preprocessor contains the […]

Read the rest of this entry »

C, C++ More Interview Questions

October 28, 2007 · Filed Under C++ Questions

1. Base class has some virtual method and derived class has a method with the same name. If we initialize the base class pointer with derived
object,. calling of that virtual method will result in which method being called?
a. Base method
b. Derived method..
Ans. b
2. For the following C program
#define AREA(x)(3.14*x*x)
main()
{float r1=6.25,r2=2.5,a;
a=AREA(r1);
printf(”\n Area of the circle is […]

Read the rest of this entry »