At 17:18 2005-10-10, Dave dm_451 wrote [bits removed]:

>If they can have it in BASIC, all these years, I don't see why we
>can't have an option to request the first element in zero or one.
>By default.
>
>int a[0]; first element is 0
>int a[1]; first element is 1
>
>The concept seems mind-bendingly simple. 
>
>Dave

The concept certainly does seem mind-bendingly simple, though I wonder if 
perhaps I might get totally confused if some arrays were 0 based and others 
were 1 based, unless this was shown clearly in the code.

Another problem with arrays in C and C++ is that no check is made on overflow. 
Now I certainly do not want the code to be making needless checks in the final 
code when released, but it is often very useful to have such checks when the 
code is being debugged. Visual Studio does help to check this, but it doesn't 
always catch incorrect indexes.

I thought I had sent you a message with a C++ class which allows an arbitrary 
range of indexes, and which allows you to include checking. If you did not see 
this code, I can dig it out and post it again.

BTW, while looking for help in a book on numerical analysis, I came across an 
apparent requirement for an array whose first element was indexed as -1.

Shraddhan


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/EbFolB/TM
--------------------------------------------------------------------~-> 

>-----------------------------------------~-~>
CHECK THE ARCHIVE BEFORE POSTING!!!! Archive is available at 
http://www.eScribe.com/software/C-Paradise/

>------------------------------------------_->


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/C-Paradise/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to