ベクトルに:ポインタは、私はこのコードを持っている
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> *vecptr;
int veclen;
void getinput()
{
string temp;
for(int i = 0; i < 3; i++)
{
cin>>temp;
vecptr->push_back(temp);
}
veclen = vecptr->size();
}
int main()
{
getinput();
for(int i = 0; i < veclen; i++)
{
cout<<vecptr[i]<<endl;
}
return 0;
}
私のコンパイラ(G ++)私にいくつかのエラーがスロー:test2.cpp:28:17:ERROR: 'で '演算子< <' の不一致をstd :: cout < < *(vecptr +((符号なし整数)(符号なし整数)i)*)1210)それを修正するために私は何ができますか?