Honestly I think I'm having a huge brainfart because I swear I've done this before but cannot think of how I did it. My goal right now is to put a list of information from a file into a multidimensional array. The file looks like this:
1 2 3 4 5 6 7
|
5
Jerry-Fischer 693-661-4427 office
Aria-Plumb 673-821-6123 office
Castro-Fyre 643-789-9876 office
Trisha-Sawyer 617-678-4567 office
Kyle-Landers 217-971-5678 office
|
The number at the top of the file is for number of entries, so I can go through the file will a for loop that iterates up to that number to store the data.
I want to store the variables because I will be searching them later, so storing name as string name, number as string number(yes, also a string) and type of contact as string contactType.
I want the array to look like this:
string array[][] = {Jerry-Fischer, 693-661-4427, office
Aria-Plumb, 673-821-6123, office
Castro-Fyre, 643-789-9876, office
Trisha-Sawyer, 617-678-4567, office
Kyle-Landers, 217-971-5678, office
}
So basically a 3 by 5 array. Idk why my brain isn't working with me today. Any help is appreciated.