#include<iostream>
#include<string>
#include<vector>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
int main()
{
int i; // okay,but haven't initialized
const int ic; // wrong : const value must be initialized
const int *pic; // okay.The pointer wants to point to a const value(not const is also valid).
int *const cpi; // wrong : the const pointer should be initialized.
const int *const cpic; // wrong : the const pointer wants to point to a const value.
// as a const pointer, it must be initialized.
return 0;
}
[C++ 学习] C++ primer 第4版 习题4.19
最新推荐文章于 2024-03-29 22:42:20 发布