I studied С++ long time and now I need to help a friend. Error and code attached.
Yuzayu cpp.sh :
// Example program #include <iostream> #include <string> #include <cmath> #include<math.h> using namespace std; int main() { /*std::string name; std::cout << "What is your name? "; getline (std::cin, name); std::cout << "Hello, " << name << "!\n"; std::cout << "KAPEZ";*/ float sqr (float fl1, float fl2){ //float s = (fl1 * fl2)/2; return (fl1 * fl2)/2; }; //std::cout << sqr (2, 3) } Mistake:
In function 'int main ()': 16:35: error: a function definition is not allowed here before '{' token
cpp.sh? - PinkTux