Having entered following command from linux terminal −
$ g++ helloworld.cpp
The a.out file should be created in the current working directory if the compilation is successful. Check if a.out is created.
To execute enter following from command line −
In most cases, output of your source program is displayed. However, as in your case, error message indicating a.out is not executable is appearing. See the properties of a.out and make it executable (if not already) by following command −
$ chmod +x a.out
You may require sudo privilege for this. In all probability this should work. all the best