All Easy Articles
The ASCII (American Standard Code for Information Interchange) NULL and zero are represented as 0x00 and 0x30 respectively. An ASCII NULL character serves as a… Read More
Size of dynamically allocated memory can be changed by using realloc(). As per the C99 standard: void *realloc(void *ptr, size_t size); realloc deallocates the old… Read More
Given an array that stores a complete Binary Search Tree, write a function that efficiently prints the given array in ascending order. For example, given an… Read More
Both languages use to try, catch and throw keywords for exception handling, and their meaning is also the same in both languages.  Following are the… Read More
In Java, if the name of a derived class static function is the same as a base class static function then the base class static… Read More
Given an unsorted array arr[0..n-1] of size n, find the minimum length subarray arr[s..e] such that sorting this subarray makes the whole array sorted. Examples:  If… Read More
What will be the output of the following program? #include<stdio.h> int main() {    int i = 10;    printf("%d", ++(-i));    return 0; } A) 11 B)… Read More
Function templates and static variables: Each instantiation of function template has its own copy of local static variables. For example, in the following program there… Read More
C++
Stack Unwinding is the process of removing function entries from function call stack at run time. The local objects are destroyed in reverse order in… Read More
An Exception is an unwanted error or hurdle that a program throws while compiling. There are various methods to handle an exception which is termed… Read More
In C/C++, precedence of Prefix ++ (or Prefix –) has same priority than dereference (*) operator, and precedence of Postfix ++ (or Postfix –) is… Read More
The modulus operator, denoted as %, returns the remainder when one number (the dividend) is divided by another number (the divisor). Modulus of Positive Numbers… Read More
Atomic Operation What is an atomic operation? An idea of atomic operation helps in understanding reentrancy, critical section, thread safety, synchronization primitives, etc… (we will… Read More
In C, a structure cannot have static members, but in C++ a structure can have static members. For example, following program causes compilation error in… Read More
A Recursive function can be defined as a routine that calls itself directly or indirectly. In other words, a recursive function is a function that… Read More
A class declaration can contain static object of self type, it can also have pointer to self type, but it cannot have a non-static object… Read More
C++
Modulus operator is costly. The modulus operator (%) in various languages is costly operation. Ultimately every operator/operation must result in processor instructions. Some processors won’t… Read More
Every literal (constant) in C/C++ will have a type of information associated with it. In both C and C++, numeric literals (e.g. 10) will have… Read More
C++
const Behaviour in C and C++ In C, the const qualified identifiers will have external linkage, where as in C++ it will have internal linkage.… Read More
Question 1 Predict the output of the following program.  C++ #include <iostream> using namespace std;   void fun(int x) {     if(x > 0)     {         fun(--x);         cout… Read More