You are not allowed to initialize x in the class definition. To initialize x, you either need a function to set the value of x (often referred to as a "setter") or a constructor which sets x to a value.

The return call you refer to returns a value to the OS (see link below) and is used to indicate successful termination of the program. It is also the return from the main function and is completely irrelevant to the OP's question.

return 0 is the correct way to end your main() program function. It's the same as saying return EXIT_SUCCESS which is the proper, portable way for your program to communicate exit status to the OS. return 1 indicates your program failed in some way and the OS should inform the user.