-
November 29th, 2011, 12:59 AM
#1
simple question regarding arrays.
When you are writing an array. how would you create 3 parallel array? Am I over thinking it and it is just initializing and stating 3 arrays? Or is there something more?
-
November 29th, 2011, 06:52 AM
#2
Re: simple question regarding arrays.
Why do you want to use 3 parallel arrays? A much better approach is to use a single array of objects with each of the objects holding the 3 types of data for that record.
-
November 29th, 2011, 10:52 PM
#3
Re: simple question regarding arrays.
Thats what my instructions call for. I have to create 3 parallel arrays that call for 1 id information. when the user enters in the id, it should display information from the 2nd (the product) and 3rd (the quantity)
-
November 30th, 2011, 06:24 AM
#4
Re: simple question regarding arrays.
Thats what my instructions call for.
In that case your first post was correct. You just create 3 arrays which must be the same size and then you access them with a common index ie if you want all the data for element 5 then you must access element 5 of each of the arrays.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|