Skip to content

Tag Archives: C++-const keyword

In this article, the various functions of the const keyword which is found in C++ are discussed. Whenever const keyword is attached with any method(),… Read More
Prerequisite: Iterators in STL Iterators are objects similar to pointers which are used to iterate over a sequence and manipulate the container elements. The advantage… Read More
Before moving forward with using const with Reference to a Pointers, let us first see what they are one by one: Pointers are used to… Read More
Whenever we use const qualifier with variable name, it becomes a read-only variable and get stored in .rodata segment. Any attempt to modify this read-only… Read More
Output of C++ program? #include <iostream> int const s=9; int main() {     std::cout << s;     return 0; } Contributed by Pravasi Meet (A) 9 (B)… Read More
#include <stdio.h> int main() {    const int x;    x = 10;    printf("%d", x);    return 0; } (A) Compiler Error (B) 10 (C) 0 (D) Runtime… Read More
Predict the output of following program. #include <iostream> using namespace std; class Point {     int x, y; public:  Point(int i = 0, int j =0)… Read More
In C++, const qualifier can be applied to 1) Member functions of a class 2) Function arguments 3) To a class data member which is… Read More
Predict the output of following program #include <iostream> using namespace std; int main() {     const char* p = "12345";     const char **q = &p;     *q… Read More