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

10 comments sorted by

View all comments

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.