vector<pair<string,int>> ques;
like below :
for(auto row: questions){
row.second++;
}
anyone ??
Yeah should work
it is throwing error prog.cpp: In function ‘int main()’: prog.cpp:35:23: error: ‘questions’ was not declared in this scope for(auto row: questions){ ^~~~~~~~~
So declare it..
i declared it in scope, and this is working fine, for(auto row: questions){ cout << row.second << " " ; }
what causes error to this ?
Where is variable questions declared?
Обсуждают сегодня