what is wrong in this : (really helpful if someone explains concept thanks : ) )
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> num={"sad sad","sdsadsadsadas","asdsasa"};
int count=0;
for(vector<string>::iterator it=num.begin(); it!=num.end(); ++it)
{
{
for(int x=0; x<*it.size(); ++x)
cout<<*it[x];
}
}
return 0;
}
order of operations.
try (*it).size() and (*it)[x]
its trying to do the .size() before it digs into the element etc
Last edited on