Wednesday, May 26, 2010

Address

Once again Fardad made me feel like I know nothing about C...
He explained what an address is. Address is nothing but an integer (I hope i got that right)... an unsigned integer.

Anther cool thing I learned today in class (and possible to get me fired from a job in coding) is that we can code arrays like this:



int a[2] = {2,4,5}
a[0]

can be rewritten as

int* b = a
b*2


On the side note, today in class, Fardad gave us a question to be answered. Using the same rules (can not use an if statement or the ? operator) add 1 line to the for loop to print out any number in the array greater than 3. I think I solved it but never tried it... I'm not sure if I should post the plausible answer or not...

No comments:

Post a Comment