Why wont this work?
I literally just started C++ and this will only print "Hello world" so why wont it print 10, I cant redo int main() so I have no idea why the test function with work it's the exact same code from the lesson with a different name #include <iostream> using namespace std; //standard namespace int main() { cout << "Hello world!" << endl; //endl means new line along with \b return 0; } /*Long comment */ /*Integer, a built-in type, represents a whole number value. Define integer using the keyword int. C++ requires that you specify the type and the identifier for each variable defined. An identifier is a name for a variable, function, class, module, or any other user-defined item. An identifier starts with a letter (A-Z or a-z) or an underscore (_), followed by additional letters, underscores, and digits (0 to 9). For example, define a variable called myVariable that can hold integer values as follows: */ int test() { int myVariable = 10; cout << myVariable; return 0; } // Outputs 10