DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Arrays?

  1. #1
    Join Date
    Jan 2008

    Question Arrays?

    As runing of array lead 2 d catastrophic failurez then Y duznt C++ provide bound checking on array operations and who is responsible to prevent array overruns?
    Please response with detail

  2. #2
    Join Date
    Jan 2005
    Bounds checking costs: First and foremost time, and secondly space.
    C++ was created with performance in mind (both in memory and in speed).
    So the answer to your second question: you are responsible for bounds-checking.
    But if you are used to that a language takes care of bounds-checks (probably you previously programmed in Java or so): You can use the slightly safer containers of the STL which are nearly as efficient as raw C++ POTs.
    Life is a short warm moment -
    Death is the long cold rest.
    Pink Floyd

  3. #3
    Join Date
    Jan 2008
    Thanks for d Reply
    what other users think ?

  4. #4
    Join Date
    Dec 2003
    well, sorry danny, but ill reply in kind:

    babysitting is for nubz. Lrn2program, k?

    Many of our readers are not speaking english as their first language, so it would be a friendly gesture to keep leet speak for your myspace page. It makes it hard to have a professional discussion across many countries and all that.

    Babysitting your array bounds is done for you by some compilers, and you can use vectors which will resize for you if you are willing to pay for the wasted time. But it is also just a programming skill to not overstep your size. Mastering that will help you with pointers and other bugs alike.

  5. #5
    Join Date
    Nov 2003
    I'm under the weather these days, so thanks jonnin for taking charge of this <high thumb up>!
    The OP has received excellent replies, so I don't have much to add to them.
    Danny Kalev

Similar Threads

  1. Passing Arrays into Functions
    By Catalyst8487 in forum C++
    Replies: 7
    Last Post: 05-08-2007, 07:48 AM
  2. Big Help w/ Arrays
    By midnightlycoder in forum C++
    Replies: 0
    Last Post: 03-23-2007, 01:36 PM
  3. Replies: 15
    Last Post: 05-09-2001, 04:40 AM
  4. VB Arrays and memory allocation
    By Brian Leung in forum VB Classic
    Replies: 12
    Last Post: 06-20-2000, 03:06 PM
  5. VB Arrays and memory allocation
    By Brian Leung in forum VB Classic
    Replies: 0
    Last Post: 06-20-2000, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center