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; }
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 }
+ 2
Ketan Lalcheta, thanks
0
Could you link the code instead?