I am studying Objective-C, I just want to know what does "[]" of [pool drain]; mean in short?
Thanks for your explanation.
I am reading "Programming in Objective-C 2.0", I found there are a lot of new type syntax, not C neither C++, or Java.
I just want to know why they don't use general syntax if you know the reasons.
Thanks for your advise.Don't fight it!
I also want to know if I can use pool.drain?
Thanks for your explanation.
I am reading "Programming in Objective-C 2.0", I found there are a lot of new type syntax, not C neither C++, or Java.
I just want to know why they don't use general syntax if you know the reasons.
I think pool.drain or pool->drain are easy to understand, maybe pool+>drain is better if they want to the newest syntax![]()
Also starWarsFilms[3] would be past the end of the array, there are only 3 actual Star Wars films(jk, episode 3 wasn't that bad).
-Lee
Java/C/C++ isn't "general syntax" it's Java/C/C++ syntax. Objective-C is older than Java, and the same age as C++, so neither of those were around to copy.
Thanks for your explanation.
I am reading "Programming in Objective-C 2.0", I found there are a lot of new type syntax, not C neither C++, or Java.
I just want to know why they don't use general syntax if you know the reasons.
I think pool.drain or pool->drain are easy to understand, maybe pool+>drain is better if they want to the newest syntax![]()
Technically, that is not quite correct. Yes, there are only 3 Star Wars films, but the array index must be adjusted to starWarsFilms[episode - 4] to correctly index the array. The later releases fell into a universe long long ago and far far away*, hence the negative indexes (that match most reviews).
*Not to be confused with Princess Fiona's hometown.
char *allThingsLucasCallsStarWars[6] = {"Episode I: The Phantom Menace","Episode II: The Clone Wars", "Episode III: Revenge of the Sith", "Episode IV: A New Hope", "Episode V: The Empire Strikes Back", "Episode VI: Return of the Jedi"};
char **starWarsFilms = &allThingsLucasCallsStarWars[3];
printf("The one with the most Jar-jar: %s\nThe first one: %s\n" starWarsFilms[-3],starWarsFilms[0]);
I can mark this as the first time i've intentionally written code to access negative array indicies and have it work.