Hello,

I have created a simple program that will be adding data into a file, but I need to get this part going first. I'm having a problem when trying to add the name of the item. It skips that line and jumps to the next one not letting me to enter the name. Any help on this will be appreciated.

Code:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cctype>

#define cMax 100

using namespace std;

void invMenu();
void crtNewItem(double Qty[], double iPrice[], char iName[], int pNumber[]);

int main()
{
    int mSelec;
    bool bDone = false;

	do{

cout << "1. Inventory Management" << endl;
cout << "\nPlease enter your selection [1-5]" << endl;
cin >> mSelec;
while (mSelec < 1  || mSelec > 5)
{
        cout << "Please enter a correct selection between 1-5" << endl;
        cin >> mSelec;
}

switch(mSelec)
{
  case 1: invMenu();
  break;

   }
}while (!bDone);
return 0;

}

void invMenu()

 {
    double Qty[cMax];
    double iPrice[cMax];
    char iName[cMax];
    int pNumber[cMax];

    int iSelec = 0;
	system("cls");

cout << "\n1. Create New Item" << endl;
cout << "\nPlease enter your selection [1-6]" << endl;
cin >> iSelec;
while (iSelec < 1  || iSelec > 6)
{
        cout << "Please enter a correct selection. [1-6]" << endl;
        cin >> iSelec;
}

switch(iSelec)
{
    case 1:
		//This calls out the fuction to create a new item.
		crtNewItem(Qty,iPrice,iName,pNumber);
    break;
}

 }

void crtNewItem(double Qty[], double iPrice[], char iName[], int pNumber[])

{
	system("cls");
	ofstream outputFile;

 outputFile.open("InvItems.txt", ios::app);

				cout << "Please enter the quantity of the item:__";
					cin >> Qty[cMax];

				cout << "Please enter the name of the item:__";
                    cin.getline(iName, cMax);

                cout << "Please enter the part number of the item:__";
                    cin >> pNumber[cMax];

				cout << "Please enter the price of the item:__";
                    cin >> iPrice[cMax];

		outputFile << Qty[cMax] << setw(10) << iName[cMax] << setw(10) << pNumber[cMax] << setw(10) << iPrice[cMax] << endl;
		outputFile.close();


                    cout << "\n************************************************";
				cout << "\nYou have just added a new item to the inventory!";
                    cout << "\n************************************************" << endl << endl;
}
Any advice on how to solve this will be appreciated. Thanks!