const int vs. int const
In C and C , there are two possible ways to declare a constant integer:
Which is the correct way? Are they equivalent?
Answer:
Both int const x = 3; and const int x = 3; are valid code and they are both equivalent. They both declare a constant integer variable named x with a value of 3.
However, in the case of pointer types, int const and const int are not equivalent.
The above is the detailed content of int const vs. const int: Are they Equivalent in C/C ?. For more information, please follow other related articles on the PHP Chinese website!