Thread: Multidimensional arrays

  1. #1
    cjoe77
    Guest

    Multidimensional arrays

    How do I use a multidimensional array to read data from an input file (1 3 4). where the first each element represents different variable types to be manipulated?

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Structure?

    I think you want an array of "structures".

    StructureArray[1].char1
    StructureArray[1].int1
    StructureArray[1].float1

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    8
    What happends if you have two seperate files and want an array for each text file. Would you declare two structures or just one?

    I have two text files. One contains names and the other phone numbers. How would I go about of having "number_array" containg all the numbers in the numbers.txt and have "name_array" contain all the names in names.txt??

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Are you working on the client only or is this a client/server? In other words, does the program read and write the data or does it read only? If this is the first case, one solution is to design the data in a structure or a class and write in binary mode. As you read them back, one solution is to store them in a container.

    Kuphryn

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    8
    kuphryn:

    thanks for the reply and this is for the client side. i'll be reading a list of names and phone numbers to create a database using a hash table. i'm not too familar about writing in binary mode but i'll do a search.

    pelp

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multidimensional Arrays
    By jordanguyoflove in forum C Programming
    Replies: 4
    Last Post: 10-16-2008, 06:16 PM
  2. Multidimensional Arrays?
    By CreatedByShadow in forum C++ Programming
    Replies: 7
    Last Post: 01-13-2006, 10:35 PM
  3. Pointers to Multidimensional Arrays
    By kidburla in forum C Programming
    Replies: 10
    Last Post: 10-29-2005, 10:45 PM
  4. Multidimensional arrays in Korn shell
    By Yasir_Malik in forum Tech Board
    Replies: 3
    Last Post: 04-11-2004, 02:16 PM
  5. Adding multidimensional arrays
    By newbie2C++ in forum C++ Programming
    Replies: 3
    Last Post: 11-13-2001, 04:05 PM