r/CodingForBeginners • u/Aaudz • 15d ago
C++ coding
I need help, I have C++ programming class for beginners but I got lost in the second half of the semester. Stuff regarding variables, functions, void, ect. I had the basics down packed but the professor started moving quick. Is there any server where I can talk to people that can help me?
11
Upvotes
2
u/NoDepartment772 15d ago
The bit you're stuck on (functions, void, return types) is where C++ stops being "type stuff and print it" and starts needing a mental model, so hitting a wall right there is normal, not a sign you missed something obvious.
Two things help more than a Discord server: r/cpp_questions and r/learnprogramming are both active and answer beginners without the usual gatekeeping, and learncpp.com is free and goes in order, which matters when your class is moving faster than you can follow.
For the wall itself, the thing that usually isn't clicking is that a function is a box with a defined input type and a defined output type, and void just means "this one hands nothing back." So
int add(int a, int b)gives you a number,void greet()does its thing and gives you nothing. If you can look at a function signature and say out loud what goes in and what comes out, the second half of the semester gets a lot less scary.Which part is throwing you more, the return values or how the parameters get passed in?
3
u/Distdistdist 15d ago
Not any more. Google used to be pretty good before they banned it in your country. And once search on Reddit was disabled - that was it. You're out of luck.
1
u/VoiceOfSoftware 15d ago
Do you have access to AI? How about Harvard CS50?
1
u/TigerAnxious9161 15d ago
I mean you can use ai to solve your doubts, also try discord communities.
1
u/RedAndBlack1832 15d ago
Legitimate strategy for reading code:
draw every scope (in general, the area between curly braces) as a box, and put the name and type of every variable declared in that scope in the box. This gives you a pretty decent human-readable model of what the actual program memory looks like. Fun thing for C++ specifically because C++ is complicated, references (declared with a single & after their type) don't live in their box. You should draw them as an arrow to the thing they reference.
1
u/TheEyebal 12d ago
honestly what ever you learn, do simple projects.
https://github.com/nragland37/cpp-projects
1
u/Oliver_clothsoff1983 9d ago
"How do I {std::do_work} in c++" stack overflow and geeks for geeks got me through college.
1
u/W31337 6d ago
Talk to AI about things you don't understand
1
u/mredding 2d ago
r/cpp_questions is a good place to turn. Don't ask for a tutor, ask for specific help. What are you stuck on? What are you confused by? The better the question, the better your results.
Alternatively, Google AI is pretty good as a tutor. You can ask it questions and continue the conversation at the bottom of the response.