Thread: array bounds checking

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    22

    array bounds checking

    Are there any utilities for Linux/Widows which check for array bound violations and possibly stack corruption in C++ programs?
    Something like an emulation of runtime provided in other languages?
    Thanks

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Check out valgrind and efence. Also, prefer a std::vector to an array and if you're really afraid use the .at method to access any elements in the vector, .at is guranteed to do bounds checking.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    22
    orbitz, thanks. valgrind looks useful.
    I need it as cure rather than prevention, debugger sometimes doesn't tell you enough about the real location of error, especially in case of stack corruption.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  3. Array bounds overflow
    By athos in forum C++ Programming
    Replies: 3
    Last Post: 08-10-2004, 12:05 PM
  4. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-11-2004, 11:15 PM
  5. Replies: 5
    Last Post: 05-30-2003, 12:46 AM