Tuesday, January 31, 2012

Day 1

The first thing I learned in this tutorial is the variable. You need to know this to store data. There are many different kind of variables, but in this tutorial, the main variables you should know right now are int, char, float, and double.  Now for our conditionals, the if statement. This is meant to check if something is true. Take not of that when using an equal sign on your Xcode, make sure to know that two equal sign,== means it is going to check if the two thing are equal to each other. One = is to assign the first value to the second value. The else statement is to check something that is not true. Now for the loops. Loop is to go through your piece of code and checks it for you. The three most common loops are the for, while, and do loop. The for loop is the basic, it executes the initiator.  Say you have the letter y= 1, and the letter i=5. Then you have x increase by 1 each time. Then soon or later x will be greater than i. Then the loop is done its job and the loop will stop. The while loop is the same as for loop, but it is like an infinite loop. This will execute the code between the brackets until something becomes false. The last is our do loop, which will execute after the block of code. The code is meant to at least run once.
Last thing would be the pointers. I was reading the tutorial, and it was very hard to understand, even the tutorial it self said it would be the hardest to learn if you are trying to learn language C. The basic wa to interpret is that if we use the word foo, and represent it with the number 123. We use the pointer to point to foo, which is the number 123. There will be more detail to this as I continue to follow this tutorial. 

No comments:

Post a Comment