Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Approaching pset1?

Course Queries Syllabus Queries

Max. 2000 characters
Replies

usr_profile.png

User

( 3 months 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!.

usr_profile.png

User

( 3 months ago )


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

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif