CS50x – Week 2

Here are some things Ive learnt so far:

  • You can create a function in the program.
  • You need to teach the program about the function. This is done by writing void chart (int score); at the top.
  • [ ] These brackets store an array. In this example it is storing 3.
  • Although not shown above, in a later example instead of 3 you can write “count”. This is a count variable. It’s useful because instead of going through the code and changing 3 everywhere, you just change the count variable.

Lastly, I learnt about the string variable.

  • C = Character. It prints out each letter of the input. Eg, a name.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s