Re: array question
From: Dan Chirillo (danchik5_at_hotmail.com)
Date: 11/21/04
- Previous message: jab3: "Re: Learning C with Older books ?."
- In reply to: beliavsky_at_aol.com: "Re: array question"
- Next in thread: Nick Forrington: "Re: array question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Nov 2004 21:15:19 GMT
You can do it in VB (pre-.net versions): dim states(1 to 50 ) as string
You cannot do it in C/C++.
Hello beliavsky@aol.com,
> David Lindauer <camille@bluegrass.net> wrote in message
> news:<419D4EB2.EE08E42D@bluegrass.net>...
>
>> Surendra Singhi wrote:
>>
>>> Indy Tech wrote:
>>>
>>>> howdy all,
>>>>
>>>> I am getting back into programming after a long enough absence that
>>>> the whole landscape has changed. I'm currently working with GCC
>>>> 3.2.2 and Visual C++ 6.0.
>>>>
>>>> I have a vague memory of a way to define arrays that they do not
>>>> contain a member array(0), but rather start at 1. Don't even
>>>> recall what lamguage it is from. Can anyone tell me if there is a
>>>> way to do this in C++?
>>>>
>>>> Thanks
>>>>
>>>> JP
>>>>
>>> I doubt if there is a way to do that in C++ or C.
>>> Definitely not in Basic.
>>> Maybe in fortran, I am not sure.
> In Fortran, the lower bound of arrays is 1 by default, but other
> integers can be specified.
>
> real x(3),y(-1:2)
>
> declares arrays with elements [x(1),x(2),x(3)] and
> [y(-1),y(0),y(1),y(2)]
>
> This generalizes to multidimensional arrays. Fortran, especially
> Fortran 90 and later versions, is better at handling arrays than
> almost any other language.
>
- Previous message: jab3: "Re: Learning C with Older books ?."
- In reply to: beliavsky_at_aol.com: "Re: array question"
- Next in thread: Nick Forrington: "Re: array question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|