r/learnprogramming • u/Beadsifyy • 28d ago
confused with pointers in c++
I dont see the need for pointers when we could just write down the normal variable name, im genuinely so confused.
34
Upvotes
View all comments
Show parent comment
3
u/Content_Mud_6469 27d ago
A few examples are possible. I am not strictly an educator, but I have mentored beginners and intermediates in code before. For something like this, pseudocode can be an effective tool.
You can explain an if-statement in the context of a for / while loop.
int x = 5 while(x < 10) { if(x == 10) { print("this is final loop") } x++ }
If-statement in the context of runtime behavior
print("Is the sky blue?") take in user input if(user input == yes) { print("correct!") } else { print("wrong!") }