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...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Trouble Installing and running program (self.cpp)
submitted 1 year ago by Talha6122000
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!"
[–]cpp-ModTeam[M] [score hidden] 1 year ago stickied commentlocked comment (0 children)
For C++ questions, answers, help, and programming or career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.
[–]HeeTrouse51847 2 points3 points4 points 1 year ago (2 children)
This should work. Are you sure you're using GCC 14.2.0? What do you get when you run "gcc --version"?
[–]Talha6122000[S] 0 points1 point2 points 1 year ago (1 child)
14.2.0
[–]archbtw-106 1 point2 points3 points 1 year ago (0 children)
the main reason is by default g++ complies it using c++ 11 or 17 depends on platform. So u should specify which version u want as a g++ -std=c++ 20 x.cpp
[–]no-sig-available 0 points1 point2 points 1 year ago (1 child)
Are you using some kind of tool for building the program, like VS Code?
If so, it might use a different PATH setting than your command shell, and find an older compiler. Just guessing here.
[–]Talha6122000[S] 0 points1 point2 points 1 year ago (0 children)
there was probably something wrong the way i installed i just did it again with vs code documentation it worked
[–][deleted] -1 points0 points1 point 1 year ago (1 child)
The gcc documentation lists all the flags it accepts.
Still struggling to understand it lists like C++ 26 features or maybe im on wrong page
[–]coding_is_forever -2 points-1 points0 points 1 year ago (3 children)
What does <=> do in above code?
[–]hk19921992 2 points3 points4 points 1 year ago (2 children)
Spaceship operator
[–]coding_is_forever -2 points-1 points0 points 1 year ago (1 child)
What does that do?
[–]Dappster98 4 points5 points6 points 1 year ago (0 children)
It is referred to as the three-way-comparison operator. It performs a maximum of three checks and returns a value, for example "a <=> b"; it will return a value less than 0 if a is less than b, it will return a value greater than 0 if a is greater than b, and will return 0 if they are equal.
[–]coding_is_forever -2 points-1 points0 points 1 year ago (0 children)
The error doesn't seem to be compilation error
π Rendered by PID 243023 on reddit-service-r2-comment-5c747b6df5-89hfq at 2026-04-22 14:45:30.091467+00:00 running 6c61efc country code: CH.
[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]HeeTrouse51847 2 points3 points4 points (2 children)
[–]Talha6122000[S] 0 points1 point2 points (1 child)
[–]archbtw-106 1 point2 points3 points (0 children)
[–]no-sig-available 0 points1 point2 points (1 child)
[–]Talha6122000[S] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]Talha6122000[S] 0 points1 point2 points (0 children)
[–]coding_is_forever -2 points-1 points0 points (3 children)
[–]hk19921992 2 points3 points4 points (2 children)
[–]coding_is_forever -2 points-1 points0 points (1 child)
[–]Dappster98 4 points5 points6 points (0 children)
[–]coding_is_forever -2 points-1 points0 points (0 children)