0

In lecture 2 (49'09''), speaking about s[i] (like in printf("%c", s[i]) ), David says: "So if you want to get at the eighth such byte, which in this loop would be bracket zero, bracket one, bracket two, bracket three, bracket four"

I understand every char is one byte, so if I want to go to the eight... I'd go to bracket 8, or maybe to 7 if we have to start counting by zero, but... bracket four??

(it continues saying "that's zero indexed up until five", but I don't understand what's indexing zero either...)

6
  • Elements are stored in an array indexwise, starting from 0 to size-1(both inclusive). kth element in the array will be stored at k-1 index, so to access the kth element, use k-1 as index. I hope you asked for the same and not something else. – sinister Sep 17 '14 at 16:23
  • I guess your answer is for the last part, right? – Martin Sep 17 '14 at 16:31
  • I intended it to be secondary, in case it clarified the main question -clarified it w brackets now) – Martin Sep 17 '14 at 16:31
  • 1
    I went to the lecture and noticed that wasn't "eight such byte", it was "ith such byte". I think this is clear now. – sinister Sep 17 '14 at 16:31
  • Awesome! Now that makes sense. The right-side captions "translated" it as eight... Thanks! – Martin Sep 17 '14 at 16:36
1

I went to the lecture and noticed that wasn't "eight such byte", it was "ith such byte". I think this is clear now.

Warning: I don't have captions.

1
  • 1
    I do, and the captions say "eight" – Martin Sep 17 '14 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .