array bounds checking

This is a discussion on array bounds checking within the C++ Programming forums, part of the General Programming Boards category; Are there any utilities for Linux/Widows which check for array bound violations and possibly stack corruption in C++ programs? Something ...

  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, 04:25 PM
  2. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 05:15 AM
  3. Array bounds overflow
    By athos in forum C++ Programming
    Replies: 3
    Last Post: 08-10-2004, 01:05 PM
  4. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-12-2004, 12:15 AM
  5. Replies: 5
    Last Post: 05-30-2003, 01:46 AM

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