arrays

This is a discussion on arrays within the C++ Programming forums, part of the General Programming Boards category; hi i have to set up an array i've got the following structure: ward good("Good",5); Med("Med",5); poor("Poor",3); Patient GoodPat[5]; Medpat[5]; ...

  1. #1
    please help
    Guest

    arrays

    hi i have to set up an array i've got the following structure:

    ward good("Good",5);
    Med("Med",5);
    poor("Poor",3);

    Patient GoodPat[5];
    Medpat[5];
    Poorpat[3];

    can someone please rephrase that in c++ as i am having trouble with arrays and c++. I got the above from a book any help would be appreciated thanks

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Try checking out our two FAQ's before we do your homework, show some effort.

  3. #3
    please help
    Guest
    Ward condition [3] ={
    good("Good",5),
    Med("Med",5),
    poor("Poor",3),
    };

    Patient condition[3]={
    GoodPat[5],
    Medpat[5],
    Poorpat[3],
    };

    attempted! is that a correct way to declare the arrays? thanks

  4. #4
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    here is a simple array declaration of type integer, with 24 elements. Remember the index for an array begins at 0 not 1.:

    int anArray[24];

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function to read in two arrays
    By ssmokincamaro in forum C Programming
    Replies: 7
    Last Post: 11-12-2008, 07:59 AM
  2. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  3. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  4. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21