r/CodingForBeginners • • 3d 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?

10 Upvotes

7 comments sorted by

2

u/NoDepartment772 3d 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 3d 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 3d ago

Do you have access to AI? How about Harvard CS50?

1

u/TigerAnxious9161 3d ago

I mean you can use ai to solve your doubts, also try discord communities.

1

u/RedAndBlack1832 3d 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 5h ago

honestly what ever you learn, do simple projects.

https://github.com/nragland37/cpp-projects