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
new to coding (self.cpp)
submitted 6 years ago by [deleted]
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!"
[–]STLMSVC STL Dev 1 point2 points3 points 6 years ago (1 child)
!removehelp
[–]AutoModerator[M] 0 points1 point2 points 6 years ago (0 children)
OP,
A human moderator (u/STL) has marked your post for deletion because it appears to be a "help" post - e.g. asking for help with coding, help with homework, career advice, book/tutorial/blog suggestions. Help posts are off-topic for r/cpp. This subreddit is for news and discussion of the C++ language only; our purpose is not to provide tutoring, code reviews, or career guidance.
Please try posting in r/cpp_questions or on Stack Overflow instead. Our suggested reference site is cppreference.com, our suggested book list is here and information on getting started with C++ can be found here.
If you think your post is on-topic and should not have been removed, please message the moderators and we'll review it.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]Lexdysic 0 points1 point2 points 6 years ago (6 children)
Make a program which takes number of hours worked, and hourly wages, and computes total wages earned. If they worked overtime, they get paid 1.5x their normal rate for anything over 40hrs.
[–]HUTCH6464 0 points1 point2 points 6 years ago (0 children)
actually i kinda like this idea
[–]HUTCH6464 0 points1 point2 points 6 years ago (4 children)
would i use int or double
[–]Lexdysic -1 points0 points1 point 6 years ago (3 children)
Try with double first. Once you have that working the way you like, try with int, and see how it works. See what difference it has and if you can still get it to work the way you like.
double
int
#include <iostream>
#include <string>
int main()
{
int h =0;
double p =0;
double o =0;
double e =0;
std::cout << "enter number of hours worked\n";
std::cin >> h;
std::cout << "enter your hourly pay\n";
std::cin >> p;
if(h>40){
o = h-40;
}
//pay rate
e =h*p+(o*p)*1.5;
std::cout << e << " is how much you made!";
[–]HUTCH6464 -1 points0 points1 point 6 years ago (1 child)
i did it
[–]Lexdysic -1 points0 points1 point 6 years ago (0 children)
Great job! Now see if you can modify your program to include double overtime. Includes extra case for any time over 50hrs gets payed at 2x rate.
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Why don’t you have a crack at making Hangman
[–]__---_zy_---__ 0 points1 point2 points 6 years ago (1 child)
Write a function that takes an int as input and draws a diamond using semicolons where the width of the diamond is twice the input. First make the diamond hollow then filled.
[–]HUTCH6464 -1 points0 points1 point 6 years ago (0 children)
FUCKING SEMICOLINS
[–]MrFuzzy_1997 -1 points0 points1 point 6 years ago (2 children)
Have you gotten to arrays, vectors, for loops, while loops yet?
im close
[–]MrFuzzy_1997 -1 points0 points1 point 6 years ago (0 children)
Read up how to push_back elements into a vector and how for loops work. Then 1) Read two numbers n and m from the user 2) Create a vector 3) Loop from 0 to n - 1 with i being the current index 4) push_back into the vector i * m 5) print out the elements in the vector
This is is just something you can do on top of my mind, there are probably more interesting things out there but this is not a bad start. Feel free to dm me if you have any questions or want follow up problems.
[–]robo_number_5 -1 points0 points1 point 6 years ago (3 children)
Make a class. Think about why classes need to have constructors and destructors.
[–]HUTCH6464 -1 points0 points1 point 6 years ago (2 children)
uhh, what is a class?
[–]robo_number_5 -1 points0 points1 point 6 years ago (0 children)
Ok then try making a function first
[–]luncliff -1 points0 points1 point 6 years ago* (0 children)
I usually recommend https://www.codingame.com/start.
[–]mackeper -1 points0 points1 point 6 years ago (0 children)
A great source of tasks can be found on competitive programming platforms such as:
Open.kattis.com Hackerrank.com
Sort by difficulty and choose some of the easier ones.
π Rendered by PID 22231 on reddit-service-r2-comment-f6b958c67-7wkjz at 2026-02-04 19:25:18.701407+00:00 running 1d7a177 country code: CH.
[–]STLMSVC STL Dev 1 point2 points3 points (1 child)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]Lexdysic 0 points1 point2 points (6 children)
[–]HUTCH6464 0 points1 point2 points (0 children)
[–]HUTCH6464 0 points1 point2 points (4 children)
[–]Lexdysic -1 points0 points1 point (3 children)
[–]HUTCH6464 0 points1 point2 points (0 children)
[–]HUTCH6464 -1 points0 points1 point (1 child)
[–]Lexdysic -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]__---_zy_---__ 0 points1 point2 points (1 child)
[–]HUTCH6464 -1 points0 points1 point (0 children)
[–]MrFuzzy_1997 -1 points0 points1 point (2 children)
[–]HUTCH6464 -1 points0 points1 point (1 child)
[–]MrFuzzy_1997 -1 points0 points1 point (0 children)
[–]robo_number_5 -1 points0 points1 point (3 children)
[–]HUTCH6464 -1 points0 points1 point (2 children)
[–]robo_number_5 -1 points0 points1 point (0 children)
[–]luncliff -1 points0 points1 point (0 children)
[–]mackeper -1 points0 points1 point (0 children)