KyaPoocha.com

Huge Collection of Interview Questions


‘C/C++ Interview Questions’ - KyaPoocha.com

What is copy constructor? 

Constructor which initializes the it’s object member variables ( by shallow copying) with another object of the same class. If you don’t implement one... Read more »

What is the use of ‘using’ declaration? 

A using declaration makes it possible to use a name from a namespace without the scope operator.  Read more »

What problem does the namespace feature solve? 

Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link with two or more such libraries. The... Read more »

What is Memory alignment? 

The term alignment primarily means the tendency of an address pointer value to be a multiple of some power of two. So a pointer with two byte alignment has a zero... Read more »

What is virtual function? 

When derived class overrides the base class method by redefining the same function, then if client wants to access redefined the method from derived class through... Read more »

When do use “const” reference arguments in function? 

a) Using const protects you against programming errors that inadvertently alter data. b) Using const allows function to process both const and non-const actual arguments,... Read more »

What is passing by reference? 

Method of passing arguments to a function which takes parameter of type reference. for example: void swap( int & x, int & y ) { int temp = x; x = y; y... Read more »

What is reference ? 

Reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object. prepending variable with “&” symbol... Read more »

What are C++ storage classes? 

C++ Storage Classes: auto: the default. Variables are automatically created and initialized when they are defined and are destroyed at the end of the block containing... Read more »

What is conversion operator?? 

Class can have a public method for specific data type conversions. for example: class Boo { double value; public: Boo(int i ) operator double() { return value; } }; Boo... Read more »

How can a ‘::’ operator be used as unary operator? 

The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers... Read more »

Describe the main characteristics of static functions. 

The main characteristics of static functions include, It is without the a this pointer, It can’t directly access the non-static members of its class It can’t... Read more »

What is name mangling? 

Name mangling is the process through which your c++ compilers give each function in your program a unique name. In C++, all programs have at-least a few functions... Read more »

What is slicing? 

Slicing means that the data added by a subclass are discarded when an object of the subclass is passed or returned by value or from a function expecting a base class... Read more »

Why doesn’t C have nested functions? 

C Compilers do not allow class types so they do not support internal function reference table like a C++ compiler does. Instead, you can use a structure having... Read more »

Page 4 of 14« First...«23456»...Last »