Timothy Weber wrote: >> In C++ (other when the added overhead really matters, confirmed by careful >> checking or profiling) I wouldn't use C-style arrays at all. C++ has safe >> arrays (std::vector). > > Good point. > [...] > the correct form is > > std::vector Array = std::vector(5); > ... > foo(Array[5]); > > ;) > > But then, all STL says is that this violates a precondition of vector; > this may or may not produce a run-time error, and it probably won't > produce a compile-time error. I don't know about compile-time errors, but AFAIK, Array.at(5) throws a (run-time) exception while Array[5] doesn't. Don't know whether that is standard behavior or specific to the STL I'm using, though. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist