simple question regarding arrays.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: simple question regarding arrays.

  1. #1
    Join Date
    Nov 2011
    Posts
    5

    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?

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    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.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Nov 2011
    Posts
    5

    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)

  4. #4
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    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.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center