Okay I'm about to dive into this chapter about Data Types and Expressions. Back when I was trying Obj-c about 7 months ago I got to this chapter and it was pretty hard for me to grasp these concepts. So do you guys have any tips for me?
Okay I'm about to dive into this chapter about Data Types and Expressions. Back when I was trying Obj-c about 7 months ago I got to this chapter and it was pretty hard for me to grasp these concepts. So do you guys have any tips for me?
1. Ask specific questions.
1b. If you're asking a question about something in a specific book, give the author, title, and version of the book. If the problem is with a specific passage or sentence in the book, then quote that specific passage or sentence, rather than paraphrasing it.
2. Don't expect anyone to remember what you did (or posted about) 6 months ago. Or one month ago. Or even one week ago, if it's on a high-traffic forum.
3. http://www.mikeash.com/getting_answers.html
Everyone is different. Some people understand data types and expressions right away. Other people have difficulty, but with different things. If you don't explain what you found hard, or why you stopped before, there really aren't any tips other than the ones I already gave.
I wasn't suggesting the book was bad (or good). I was simply pointing out that you hadn't identified the book, so there's no way for anyone else to tell you whether the chapter on data types and expressions might be harder or easier to understand than some other book. There's also no way to suggest a complementary book that might give better explanations in this case. You also didn't explain why you found the explanations in the book hard, whether it's lack of background, unfamiliar terms, or whatever.
One example of a difficulty: a guy I worked with was learning C. He came from a mathematics background, so already understood arithmetic expressions, complex calculations, iterative algorithms, number theory, etc. but had never learned any programming language. In one of his programs, he declared some variables as type 'float', then used them as subscripts for C arrays. This didn't work. When he asked me why, I told him that subscripts have to be integers. He assured me they were in fact integers, and sure enough, the values of the variables were integers (0.0, 1.0, 4.0, etc.). I then explained to him that it didn't just have to be an integer number, but the type had to be an integer type. That lead into an explanation of binary numeric representations, especially the difference between the integer types and the floating-point types. He had a specific difficulty (float types used as array subscripts), that took a specific explanation to resolve (numeric representations).
So does this mean that any thing that I typed out in lets say NSLog is a constant character string object?In Objective-C, any number, single character, or character string is known as a constant. For example, the number 58 represents a constant integer value.The string @Programming in Objective-C is fun.\n is an example of a constant character string object. Expressions consisting entirely of constant values are called constant expres- sions. So this expression is a constant expression because each of the terms of the expres- sion is a constant value:
128 + 7 - 17
So does this mean that any thing that I typed out in lets say NSLog is a constant character string object?
NSLog( @"%d", 27 );
NSLog( @"%f", 355.0/113.0 );
NSLog( @"%c %c", '6', 'c'+1 );
NSLog( @"%s", "xyzzy" );
NSLog( @"%@", @"foo" );