how do i compile it so it will create either the name of the .c file i compile or a name of my choosing.....
Save your code in an ordinary text file as:
Then to get an executable with the same name
without the .C extension do
g++ path_to_sourcefile.C -o sourcefile
Here.. the executable is created in your current working directory.
....... and for a different name.. simply
g++ path_to_sourcefile.C -o executable_name