23.1.09

Usage of "void" date type

Usage void type in C:

sizeof void type is implemented as "1". And In "C" we can have the flexibility to increment the void pointer.

Usage of void type in C++:


In C++, incrementing "void" pointer is not permitted. And sizeof(viod type) throws an error saying that type is unknown.

15.10.08

General C++ Interview questions

I have categorized Interview questions in three categories

- Basic:

- Advanced:

- STL:

BASIC C++ Interview questions:


Under OOPS concept:


- What is Class

- What is Object

- What are the different access specifiers in class.

- What is abstraction

- what is encapsulation

- what is Polymorphism

- compile time polymorphism

- run time polymorphism

- virtual function

- what is inheritance and why

Language Specific:


what is the difference between new and malloc

difference between free and delete

when to use delete and when to use free

what is operator overloading

what is friend function

Constructor and Destructor

what is reference and how it is different from pointer.

exception handling

try, throw and catch.

this pointer.

why friend function requires two arguments in binary operator overloading?


what is late binding.

what is the difference between inline functions and macros?

what is namespace

static data member initialization

overloading and overriding?

default arguments usage in functions

what is name mangling?



Advanced:


what is the size of empty class and why

what is Vtable and layout of Vtable

What is the use mutable?

what is copy constructor?

what is the use of const?

what is const correctness?

static_cast, dynamic_cast and reinterpret_cast.

what is pure virtual function?

what is abstract class?

What is the use of Using clause?

Code examples on Virtual functions

copy constructor assignment operator?

deep copying and shallow copying?

how to use c-style functions in C++ / usage of extern