0

I have a problem

#include <iostream> #include <vector> using namespace std; struct guitar { int G; int S; vector<int> v; void inf() { cin>>G; while (cin>>S) { v.push_back(S); } } int sizef = v.size() -1; void ff(){ --sizef; while(true){ if(sizef < 0) break; f(); } } void f(){ int res = v[sizef]; while(v[sizef]!=G || v[sizef]==G){ if(v[sizef]==G){ cout << v[sizef] << " is a guitar\n"; break; } else if(v[sizef] > G){ ff(); } v[sizef] = v[sizef] + res; } }; int main(){ cout<<"To stop, enter some letter"<<endl; guitar g; return 0; }

5th Sep 2018, 7:24 PM
Storm_CR
Storm_CR - avatar
3 Answers
+ 2
oleg sapovsky what you want to achieve through this code.. just a structure and nothing called from main function... I just checked in code playground and observed that one closing braces is missing...whenever you are doing end of function f() with }; do it with one more additional brace like }}; and your code Will compiler... just to conclude, ensure number of opening brcaes { with number of closing braces }
6th Sep 2018, 1:49 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 2
Ketan Lalcheta, thanks
6th Sep 2018, 3:33 AM
Storm_CR
Storm_CR - avatar
0
Could you link the code instead?
5th Sep 2018, 8:04 PM
Daniele Bonomi
Daniele Bonomi - avatar