Day 1: Data Types – Hacker Rank

Short problem descriptions: Declare variables: one of type int, one of type double, and one of type String. Read lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your variables. Use the operator to perform the following operations:

Commonly asked interview questions for 3+ experience C++ candidate

Here we have list out frequently asked C++ questions for 3 years experience C++ developer interview questions. Commonly asked interview questions for 3+ experience C++ candidate What is encapsulation? Data encapsulation is the mechanism to hide the implementations and expose only interfaces. The best examples for data

Guess The output of the program in C/C++ part 1

Here we have an interesting concept to predict the ¬†output of the C/C++ program part one. Its just beginning. Just guess the output of the following C/C++ program. Will it compile properly? If yes what will be the output of the program? [crayon-58d85fb86121d760488677/]   Guess the output

How to find the n-x position in the linked list

How to find the n-x position in the singly linked list. In linked list size of linked list is unknown. Say for example if there are 100 nodes in the linked list you need to find the 92 nd node which is n-x (100-8) th node of

Copy constructor in c++

Copy Constructor: Copy constructor is the member function which used to initialize the object with already existing object of the same class. [crayon-58d85fb86175a952855489/]   why copy constructor syntax is reference? In case if your copy constructor syntax is like classname(const classname obj), then this will recursively call

Why copy constructor arguments should be const behavior in c++

Why copy constructor arguments should be const behavior in c++? Normally we create copy constructor with const reference why because we don’t want objects to be modified accidently inside the copy constructor. That is not only the reason there are one more reason also there. Let us

Copy Elision in C++

Copy Elision in C++ copy elision is the technique that avoid unnecessary copying of the objects. Under the following circumstances, the compilers are required to omit the copy- and move- constructors of class objects even if copy constructor and the destructor may produce side effect. [crayon-58d85fb861e55013862311/]  

Difference between macros and inline function

Difference between macros and inline function Both macros and inline functions are differed in the way of handling. Macros are expanded by C++ preprocessor and inline functions are parsed by C++ compiler. Macros will not do operations it will  just replace the values but inline function will

Guess the output of the program in C++ Part 1

Here we have two programs. Guess the output of the program. Predict the output for the following C++ program. Program 1: [crayon-58d85fb862344069170285/] Do you really think this program will work. My answer is this program will fail in compilation. A member of a derived class will, by

How can we able to call member function using class objects

How/Where member functions stored in class objects We all know member functions are not part of class members. sizeof class can not depends on member function. why because if its part of class member there may be the huge memory wastage. Member functions are stored on code