1

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!.

2 Answers 2

2

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...

1
  • 1
    I apologise for the extremely late reply! I wasn't aware you'd actually replied to my comment! Thank you!
    – Izaak Dew
    May 19, 2015 at 11:51
2

Welcome aboard!

I'm definitely struggling quite a bit - I'm at a loss for where to start with my Mario project.

I recommend you read the specifications in the specification page carefully and watch Zamyla's walkthroughs. They are often very useful particularly if you are not sure how to start.

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 not an expert, but I think this is normal at the beginning specially for those who have no prior experience in programming. Feel free though to search for/ask about things that you are not getting very well! You may also read any of the recommended books per the syllabus and solve the exercises there. I think practising is one of the most important and effective ways to get a perfect understanding of what all of these are, for what/how they are used, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .