exception(logic error and runtime error)

Discussion in 'C++' started by Tony Johansson, Aug 13, 2005.

  1. Hello Experts!

    I reading a book called programming with design pattern revealed
    by Tomasz Muldner and here I read something that sound strange.

    "Exception are divided into logic errors and runtime errors. Logic errors
    represent static errors that
    can be prevented and detected at compile time. Runtime errors represent
    dynamic errors that can be detected only at runtime."

    Now to my question what does it mean with "Logic errors represent static
    errors that
    can be prevented and detected at compile time." The compiler will not detect
    if you index out of range
    in an array so why does it then say that Logic errors represent static
    errors that
    can be prevented and detected at compile time. It exist an logic_error class
    exception that has name out_of_range.

    Many thanks

    //Tony
     
    Tony Johansson, Aug 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Dob
    Replies:
    4
    Views:
    6,201
    Rob Dob
    Mar 30, 2006
  2. Tom Ewall
    Replies:
    5
    Views:
    409
    Dale King
    Apr 15, 2006
  3. manish
    Replies:
    1
    Views:
    1,977
    Christopher Benson-Manica
    Apr 2, 2004
  4. Hal Vaughan
    Replies:
    11
    Views:
    1,141
    Gordon Beaton
    May 22, 2006
  5. spike
    Replies:
    8
    Views:
    1,486
    Steve Holden
    Feb 9, 2010
Loading...

Share This Page