ANSIC允许声明常量,常量和变量不同,常量就是不可以改变的量,用关键字const来修饰 比如:const int a int const a 以上两种声明方式是一样的,我们不需要考虑const和int的先后顺序,按照你理解的方便的一中方式进行应用. 因为const和int的顺序先后并不影响结果,因此 int const * && const int *这两中情况就是一样的 所以我们只需要讨论两种情况 -----------------------------------------…
This interview question come from a famous communication firm of china. : ) #include <iostream> #include <stdio.h> #include <string.h> #include <conio.h> using namespace std; int main() { float a = 1.0f; cout << cout <<…
Some people may be confused about the sequence of const and * on declaration in C++/C, me too. Now I think we can distinguish them by this way: 1.only noticing the position of const to *, and we can find that the following statements are same: const…