Skip to content

Category Archives: GFacts

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
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
In C, struct keyword must be used for declaring structure variables, but it is optional in C++. For example, following program gives error in C… Read More
Following relationship holds in any n-ary tree in which every node has either 0 or n children. L = (n-1)*I + 1 Where L is… Read More
Enumeration constants (enum values) are always of type int in C, whereas they are distinct types in C++ and may have size different from that… Read More
The number of structurally different Binary Trees with n nodes is Catalan number Cn = (2n)!/(n+1)!*n! References: My Personal Notes arrow_drop_up Save
It is compiler dependent in C. It is never safe to depend on the order of evaluation of side effects. For example, a function call… Read More
To uniquely construct a Binary Tree, Inorder together with either Postorder or Preorder must be given (See this for details). However, either Postorder or Preorder… Read More
In C, variables are always statically (or lexically) scoped i.e., binding of a variable can be determined by program text and is independent of the… Read More
“Pointer arithmetic and array indexing [that] are equivalent in C, pointers and arrays are different” – Wayne Throop References: My Personal Notes arrow_drop_up Save
There are various ways to overload Operators in C++ by implementing any of the following types of functions: 1) Member Function 2) Non-Member Function 3)… Read More
In C, return type of getchar(), fgetc() and getc() is int (not char). So it is recommended to assign the returned values of these functions… Read More
What values do the printf() and scanf() functions return ?   printf() : It returns total number of Characters Printed, Or negative value if an output… Read More
The sizeof operator is used to return the size of its operand, in bytes. This operator always precedes its operand. The operand either may be… Read More

Start Your Coding Journey Now!