Understanding Variables

Continuing with the Harvard X CS50 course. I’ve started taking notes, even writing all the code examples down in my notebook. I feel it’s helping become more familiar with the concepts.

I am understanding variables a little more, as in this example:

(int i = 0; i < 50; i++);

This means,

  1. The variable or (int) in C language has a var name called i and it is set to 0.
  2. The variable checks the condition. So, when i < 50 the code will continue to execute.
  3. i++ means that if the code is still < 50, 1 will be added to the variable.

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