- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between const int*, const int * const, and int const * in C/C++?
The above symbols mean the following −
int* - Pointer to int. This one is pretty obvious. int const * - Pointer to const int. int * const - Const pointer to int int const * const - Const pointer to const int
Also note that −
const int * And int const * are the same. const int * const And int const * const are the same.
If you ever face confusion in reading such symbols, remember the Spiral rule: Start from the name of the variable and move clockwise to the next pointer or type. Repeat until expression ends.
- Difference between const int*, const int * const, and int const * in C
- What is the difference between const int*, const int * const, and int const *?
- What is difference between int and const int& in C/C++?
- Difference between const char* p, char * const p, and const char * const p in C
- Difference between #define and const in C
- Difference between readonly and const keyword in C#
- Const Qualifier in C
- Const cast in C++
- Difference between #define and const in Arduino
- Const member functions in C++
- Explain the difference between const and readonly keywords in C#
- Function overloading and const keyword in C++
- Declare a const array in C#