I think the best way for me to explain this is to show you guys what im trying to do.
#include <iostream>
class customer
{
int CustID;
public:
void CCustRecords(int NumOfCust)
{
x = NumOfCust;
for(int i = 0; i < x; ++i)
{
cout << "Enter the Customers ID number. " << endl;
cin >> CID;
CID[i].CustID = CID;
}
}
};
void main()
{
int NumOfCust, EmployeeID;
Employee emp;
customer cust;
cout << "Welcome to the MED Recorde Managemant System" << endl;
cout << "--------------------------------------------" << endl;
cout << endl << "Authorized Personel Only" << endl;
cout << "Please Enter your Employee ID code " << endl;
cin >> EmployeeID;
if(EmployeeID == emp.EmployeeID)
{
cout << "Please enter the number of Customers you want" << endl;
cin >> NumOfCust;
cust.CCustRecords(int NumOfCust);
customer *CID = new customer[NumOfCust];
cout << endl << endl << endl;
cout << "Access Granted!" << endl;
cout << "----------------" << endl;
while(iface != 1)
{
cout << endl << "Please select one of the following" << endl;
cout << endl << "1)Creat Customer records" << endl;
cout << endl << "2)Exit Program" << endl;
int iface;
cin >> iface;
if(iface = 1)
{
cust.CCustRecords(int NumOfCust);
break;
}
else
cout << "Exiting Program" << endl;
}
delete [] CID;
}
else
cout << "I'm sorry but you entered the wrong number" << endl;
}
I'm in school and need help trying to input data into the dynamic array thats inside a class. I made a test program that worked but use a structure inside the main function. I dont understand what i'm missing. If you guys could give me a few pointer in the general direction, certain general areas to study, it would help and a brief example but nothing in detail. Ill find those. Thanks for you time. The error i get is: error C2109: subscript requires array or pointer type