Tag Archives: C++-const keyword

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? filter_none edit close play_arrow link brightness_4 code #include <iostream> int const s=9; int main() {     std::cout << s;     return 0; }… Read More
filter_none edit close play_arrow link brightness_4 code #include <stdio.h> int main() {    const int x;    x = 10;    printf("%d", x);    return 0; } chevron_right filter_none… Read More
Predict the output of following program. filter_none edit close play_arrow link brightness_4 code #include <iostream> using namespace std; class Point {     int x, y; public:… 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 filter_none edit close play_arrow link brightness_4 code #include <iostream> using namespace std; int main() {     const char* p =… Read More