65,211
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <vector>
using namespace std;
int main()
{
//const vector<int> a(12,5); //const_reference at(size_type pos) const;
//vector<int>a(12,5) //reference at(size_type pos);
int b=a.at(3);
system("pause");
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
int main()
{
//const vector<int> a(12,5); //const_reference at(size_type pos) const;
//vector<int>a(12,5) //reference at(size_type pos);
int b=a.at(3);
system("pause");
return 0;
}
class A
{
public:
A():
a(12,5)
{
}
void Func() const
{
a.at(3);
}
private:
vector <int> a;
};