reference operator[](size_type n) Random Access Container Returns the n'th character.
can you tell me how to use it,
i tried as following but it showed me compile error!
- Code: Select all
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
vector<string> a;
string input;
int len;
char ch;
cin>>input;
a.push_back(input);
len = a.size();
for(int i=0;i<len;i++) {
ch = a[i];
cout<<ch;
}
cout<<endl;
return 0;
}


