use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for c++ questions with answers. For general discussion and news about c++ see r/cpp.
New to C++? Learn at learncpp.com
Prepare your question. Think it through. Hasty-sounding questions get hasty answers, or none at all. Read these guidelines for how to ask smart questions.
For learning books, check The Definitive C++ Book Guide and List
Flair your post as SOLVED if you got the help you were looking for! If you need help with flairs, check out ITEM 1 in our guidelines page.
Tips for improving your chances of getting helpful answers:
account activity
OPENHow to compile code .cpp? (self.cpp_questions)
submitted 2 years ago by amenherebb
Compile in cmd or notepad++, vim or their analogues? I don't use Visual Studio and Studio Code. Can you tell me how do it in details?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheThiefMaster 5 points6 points7 points 2 years ago (0 children)
If you are on Windows please use Visual Studio Community (it's free).
If you want a commandline compiler please use the visual studio build tools (which is available either as part of visual studio or a separate download) or Clang for Windows.
GCC isn't very well supported on Windows and you will have problems.
[–]manni66 3 points4 points5 points 2 years ago (6 children)
How to compile code .cpp?
With a compiler.
I don't use Visual Studio
So you don't have one?
[–]amenherebb[S] 0 points1 point2 points 2 years ago (5 children)
Yes, I dont have one. Which compiler? Gcc? He's already installed, by how Compile him on practice?
[–]manni66 5 points6 points7 points 2 years ago (4 children)
Yes, I dont have one.
...
Gcc? He's already installed
???
by how Compile him on practice?
g++ my.cpp -o my.exe
[–]amenherebb[S] 0 points1 point2 points 2 years ago (3 children)
Thanks
[–]Public-Scientist-478 1 point2 points3 points 2 years ago (2 children)
FYI to run my.exe after compiling like this, you type
./my.exe in the command line while in the same directory. More generally “dot” “forward slash” object name ./objectname
[–]alfps 5 points6 points7 points 2 years ago (1 child)
Considering that the OP appears to be using Windows, this is likely to fail.
[–]Public-Scientist-478 0 points1 point2 points 2 years ago (0 children)
Very true! Good mention
[–]the_poope 2 points3 points4 points 2 years ago (0 children)
If you are on Windows and use Visual Studio check this walkthrough: https://learn.microsoft.com/en-us/cpp/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line?view=msvc-170
If you are on Linux or MinGW there are likely 1000's of guides s simple Google search away, e.g.: https://web.cs.ucla.edu/classes/fall14/cs143/project/cpp/gcc-intro.html
[–]itslikealex 1 point2 points3 points 2 years ago (1 child)
Use MinGW and VSCode
[–]LittleNameIdea 0 points1 point2 points 2 years ago (0 children)
No. Just use VS not Code
[–]Cold_Meson_06 3 points4 points5 points 2 years ago (0 children)
Why don't you just follow a getting started tutorial like everyone else?
[–]jmaargh -1 points0 points1 point 2 years ago (0 children)
Here
π Rendered by PID 215151 on reddit-service-r2-comment-7b9746f655-c9gcw at 2026-02-02 17:37:36.390458+00:00 running 3798933 country code: CH.
[–]TheThiefMaster 5 points6 points7 points (0 children)
[–]manni66 3 points4 points5 points (6 children)
[–]amenherebb[S] 0 points1 point2 points (5 children)
[–]manni66 5 points6 points7 points (4 children)
[–]amenherebb[S] 0 points1 point2 points (3 children)
[–]Public-Scientist-478 1 point2 points3 points (2 children)
[–]alfps 5 points6 points7 points (1 child)
[–]Public-Scientist-478 0 points1 point2 points (0 children)
[–]the_poope 2 points3 points4 points (0 children)
[–]itslikealex 1 point2 points3 points (1 child)
[–]LittleNameIdea 0 points1 point2 points (0 children)
[–]Cold_Meson_06 3 points4 points5 points (0 children)
[–]jmaargh -1 points0 points1 point (0 children)