Arrays in C++

Arrays in C++ C++ offers derived data type namely ‘arrays’, that can hold several values of the same type. Derived Data Types are built from basic data types, i.e. from integer, float, double, etc.. An Array is a collection of variables of the same type that are referenced by a common name. In other words,…

getchar(), putchar(), gets() and puts() The Console IO functions are : getchar() putchar() gets() puts() where getchar() and putchar() are single character functions and gets() and puts() are string functions. Header files for these above functions : “stdio.h” Single Character Functions : getchar() and putchar() Single Character functions are used for reading and displaying a single…

getline c, get c, put c and write c – Unformatted stream I/O functions getline c, get c, put c and write c – These functions are called unformatted stream IO functions where get() and put() can handle single character input and output and getline() and write() can handle multi character input and output. Header files…

break Statement in C

break Statement in C : break statement in c is a jump statement which skips over a part of the code just like a continue statement. The break statement is somewhat different from continue statement as execution of this statement does not suspend the next iteration but the iteration will be terminated from the loop. Execution resumes at the statement immediately following…

Continue Statement in C

Continue Statement in C : continue statement in c is a jump statement which skips over a part of the code just like a break statement. The continue statement is somewhat different from break as execution of this statement does not terminate from the loop but  it suspend the next iteration and forces the next iteration of the…

goto Statement in C

goto Statement in C : The goto statement in C or C++ is rarely used in programming today. This statement is a part of jump statements in C or C++. What does a goto Statement do ? A goto statement in C or C++ can transfer the program control anywhere in the program i.e. alters…

Dynamic Memory Allocation  in C with Example Dynamic memory allocation refers to the manual memory management in the C language. Need of Manual Memory Management/ Dynamic Memory Allocation : In case of array, the programmer must declare the size of the array during compile time (the time when a compiler compiles code written in a programming language…

Memory Layout of C++ Memory Layout of C++ : Let us understand how C++ organizes memory for its programs. After compiling a program, C++ create four logically distinct regions of memory that are used for different distinct specific functions. These are : Program Code Region Global Variables Region Heap Region Stack Region Regions : Program code…