아니다, 나는이 문제가 : 두 번째 for
루프에서첨자 값이 난 그냥 프로그래밍을 배우기 시작 배열, 포인터, 또는 벡터
- 를이 첨자 값이 배열 포인터, 또는 벡터 아니라고한다 .
- 몇 가지 이유로 나는 프로그램을 빌드 할 수 없습니다.
-
#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]'? – P0W
'int'가 배열, 포인터 또는 벡터가 아니기 때문에 프로그램을 빌드 할 수 없습니다. 두 번째 루프에서 무엇을 기대합니까? – IllusiveBrian