in C ++ you need to define or at least declare functions before calling them.
What you are trying to do so far looks something like this:
int main() { cout << b; int b = 10; }
So you can also try:
#include <iostream> using namespace std; void HelloWorld(); int main() { HelloWorld(); return 0; } void HelloWorld() { cout << "Hello, World" << endl; }
Good practice in C ++ to define all other functions before the main function.
gprathour Nov 23 2018-11-11T00: 00Z
source share