Original Post
I have a pointer to a vector, now i assigned it some values but I can't retrive them back using [] operator. Do i need to cast something? i want to be able to do this : c=v; Thanks in advance :)
#include<vector>
#include<iostream>
using namespace std;
int main()
{
vector<char> *v;
v= new vector<char>;
v->push_back('h');
v->push_back('e');
v->push_back('l');
v->push_back('l');
v->push_back('o');
char c;
c=v[0];// error
v->clear();
delete v;
return 1;
}