I'm really struggling to come to terms with the idea of how to use GetInt.
You can imagine "GetInt" to be a kind of a mailman that delivers the "Int" (that the user has entered) to you/your code.
Now you have to provide a mailbox/container/variable where the mailman can put the "GetInt"-letter. Otherwise you couldn´t do anything with it.
That means: It is not sufficient to call the GetInt()-function. You have to assign the value (content) to a variable.
// This won´t do anything:
...;
GetInt();
...;
// This is how you can access the Int that the user typed in.
int postbox = GetInt();
I hope this helps...
manpreet
Best Answer
2 years ago
I'm a 16 year old student trying to grasp the concepts of C in Week 2 of the course and I'm definitely struggling quite a bit - I'm at a loss for where to start with my Mario project. To help myself, I'm refreshing on Week 1 and 2 but I'm honestly feeling very lost with many functions and concepts in C. I've grasped the concept of the printf function (I know this is as basic as it gets) but that is genuinely the level of understanding I have. I'm understanding what strings, integers, floats and all those types are but putting it all together seems very puzzling.
I'm really struggling to come to terms with the idea of how to use GetInt.
Are there any other resources that I can look to for some guidance? I can't search for help elsewhere on the web of course because we're using the CS50 library.
Any help would be really appreciated!.