Iterating through the array

Hi,
I need help with my for loop. I'm trying to read some value from the file.

#include <iostream>
#include <iomanip>
#include<fstream>
#include <string>
using namespace std;
const int NUMEMPLOY = 5; // this const to be used as size of the array

int main()

{
char menu;
char quit;
int count[NUMEMPLOY];
ifstream inputFile;
inputFile.open("data.txt");

for (int i = 0; i < NUMEMPLOY; i++)
{
inputFile >> count[i];
cout << count[i] << " ";
}

if (!inputFile.eof())
cout << "Data file not found\n";

do
{
cout << "Which one of the following you like to pull out from our data file? " << endl;
cout << " 1. to search salary\n";
cout << " 2. to generate stat file\n";
cout << " 3. to print salaries\n";
cout << " 4. to Quit\n";
cout << "Enter your choice :\n";
cin >> menu;
}
while (menu < 4);


switch (menu)

{
/********************************************************
* *
* CASE 1 *
* *
*********************************************************/
case '1':
{
int salary;
if (menu = 1)
{
cout << "Enter your salary\n";
cin >> salary;
}

for (int j = 0; j < NUMEMPLOY; j++)

{
cout << endl;
cin >> count[j];

}
bool match = false;
{
if (match)
{
cout << "match found\n";
}
else
{
cout << "match was not found\n";
}
}
}
break;
]
for (int j = 0; j < NUMEMPLOY; j++)

{
cout << endl;
cin >> count[j];

}
Last edited on
Topic archived. No new replies allowed.