4 ms·
Porting stuff from Pascal is prone to off-by-one errors due to 1-based arrays.
by iwwr 16y ago
Porting stuff from Pascal is prone to off-by-one errors due to 1-based arrays.
- redstripe 16y agoArrays can have any base in pascal including zero. Do you mean strings?
- TimJYoung 16y agoAs already mentioned, that's not correct. You can declare arrays with any indexing/bounds that you want: MyArray: array[1..10] of Byte; or if you want something that can be used as a buffer: MyCharArray: array[0..19] of Char; StrCopy(@MyCharArray,'Hello World'); // array acting like a 0-indexed Char buffer