Thread: Code journal (mistakes)

  1. #1
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128

    Unhappy Code journal (mistakes)

    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.
    Muhammad Haggag

  2. #2
    Administrator webmaster's Avatar
    Join Date
    Aug 2001
    Posts
    1,012
    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++)

  3. #3
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128
    Alright, thanks.
    Muhammad Haggag

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  2. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  3. Code Journal
    By kwigibo in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-15-2002, 06:47 AM
  4. Replies: 4
    Last Post: 01-16-2002, 12:04 AM
  5. Code Journal & Submissions?
    By QuestionC in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-13-2002, 09:06 PM