Array question

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
spysmily1
Newbie
Posts: 4
Joined: Fri Apr 28, 2006 1:59 am
Contact:

Array question

Post by spysmily1 »

Are all elements of an array stored in consecutive memory like in C?

Also if they are given storage ahead of time and you declare an array without a type how does it know how much space to give without knowing the type?
RayBritton
Veteran
Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Post by RayBritton »

I think you have have to declare type, including string length
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Re: Array question

Post by Antoni »

>Are all elements of an array stored in consecutive memory like in C?
Yes, they are

>Also if they are given storage ahead of time and you declare an array without a type how does it know how much space to give without knowing the type?
Arrays in QB always have a type, if you omit it the default type is used (SINGLE).
spysmily1
Newbie
Posts: 4
Joined: Fri Apr 28, 2006 1:59 am
Contact:

Array question

Post by spysmily1 »

Thx Antoni, i did finally find the qb help file for the default type, but your 1st answer helps alot.
Post Reply