Main.cc: In function 'std::string x(int, int)': Main.cc:22:22: error: a function-definition is not allowed here before '{' token int k(string s,int x){ ^ Main.cc:5:11: warning: unused variable 'i' [-Wunused-variable] int x,i; ^ Main.cc:47:5: error: expected '}' at end of input } ^