Code journal (mistakes)

This is a discussion on Code journal (mistakes) within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Exclusive OR encoding C++ does not have a built-in Exclusive-OR function, however. ^ is the operator for exclusive ORing. Hashing ...

  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
    967
    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, 03: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-15-2002, 11:04 PM
  5. Code Journal & Submissions?
    By QuestionC in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-13-2002, 08:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21