参数之间有什么区别:
int foo1(const Fred &arg) {
...
}
Run Code Online (Sandbox Code Playgroud)
和
int foo2(Fred const &arg) {
...
}
Run Code Online (Sandbox Code Playgroud)
?我没有看到parashift FAQ中涉及的这个案例.
我最近决定我必须最终学习C/C++,有一件事我不太了解指针,或者更确切地说,他们的定义.
这些例子怎么样:
int* test;int *test;int * test;int* test,test2;int *test,test2;int * test,test2;现在,根据我的理解,前三个案例都是相同的:测试不是一个int,而是一个指针.
第二组示例有点棘手.在case 4中,test和test2都是指向int的指针,而在case 5中,只有test是指针,而test2是"real"int.案例6怎么样?案例5相同?