PDA

View Full Version : Code journal (mistakes)



Coder
01-10-2002, 11:53 PM
Exclusive OR encoding

C++ does not have a built-in Exclusive-OR function, however.

^ is the operator for exclusive ORing.

Hashing

To find element 50 of an array named "employees" you have to access it like this:

employees[50];

That'd get me element 51, not 50. If the array size was 50, this would've given me an access violation.
C & C++ use zero-based indices.

I'm sorry if someone noted this in some other post, I failed to find any. And I was really frustrated by this, never expected it, that I haven't continued reading the journal.

webmaster
01-11-2002, 10:53 PM
The XOR article mistake has been noted under the thread titled "Newsletter". The Hashing article mistake hasn't been noted, probably because it isn't part of a program. (Eric does know that's incorrect; I imagine it slipped his attention when he was writing because he was mixing english and C++)

Coder
01-12-2002, 05:18 AM
Alright, thanks.