All those errors are the reason it didn't compile. If it didn't compile, then you have no program to run.
I've seen people simply type the cpp filename with the g++ or gcc and have the program execute |
I expect you've seen people create programs with the
same name as the cpp source file.
For example, you could have a cpp source file called "program.cpp" and you could then compile it into a program called "program.exe" ; two different files, with similar names.
When you type this:
\mingw\bin\g++ HelloWorld.cpp
you are running the program named "g++" and you're asking it to create a new program, using HelloWorld.cpp as the source file. This is how the command line works. You pick a program to run, and sometimes you feed it some extra input; in this case, the program to run is g++, and the extra parameter that you are giving to g++ is the string "HelloWorld.cpp".
You can think of gcc as the program that turns C code into programs. That's why you had the problem; you were running a program that turns C code into programs, but you're got
C++ code. You could think of g++ as the program that turns C++ code into programs.
You didn't tell g++ what to name the new program, so it will have picked something for you. So take a look in the directory that you were in when you ran g++, and see if there's a new exe file in there ; that will be the program you created.
Is c++11 the current standard? |
C++17 is, but this has nothing to do with C++ standards. This is about how compiled programming languages work. Your "intro to C++" course has unfortunately skipped a lot of the basics of how programming works and how programs get made.
You could read everything you missed here:
https://www.daniweb.com/programming/software-development/tutorials/466177/understanding-c-from-source-to-binaries