I just started learning programming, I have two problems:
- At the second
forloop it says subscripted value is not an array, pointer, or vector. - For some reason i cant build the program.
-
#include <iostream>
#include <iomanip>
#include <stdio.h>
using namespace std;
const int SIZE = 100;
string inputString(string, int, int);
void clearCIN();
double inputDouble(string, double, double);
int inputInt(string, int, int, int);
int main(int argc, const char * argv[]) {
int empNo [SIZE];
string empName [SIZE];
double empPay[SIZE];
int userEntry = 0;
int count = 0;
int secom
cout << "Welcome to Employee management program";
for (count = 0 ; count < SIZE; count ++) {
userEntry = inputInt("please enter a employee number;", 0, 1000, -999);
if (userEntry == -999)
break;
else
empNo[count] = userEntry;
empName[count] = inputString ("Please enter a name (1-15 characters)", 1, 15);
empPay[count] = inputDouble ("Please enter the employee's pay)", 0, 100000);
}
cout << setw(9) << left << "Employee ID" << setw(9) << right << "Employee Name" << setw(9) << "Employee Salary" << endl;
cout << setw(9) << left << "======================" << setw(9) << right << "=========" << setw(9) << "=========" << endl;
cout << setw(9) << left << userEntry << setw(9) << right << empName << setw(9) << empPay << endl;
for (int secondCount = 0 ; secondCount < count; secondCount++) {
cout << setw(9) << left << userEntry [secondCount] << setw(9) << right << empName [secondCount] << setw(9) << empPay [secondCount] << endl;
return 0;
}
}
userEntry [secondCount]?intis not an array, pointer, or vector, what do you expect your second loop to do?