Hello everyone, I am new here and am having a problem with a homework assignment. I am supposed to write a program creating two empty arrays, and have the user add information to them. The part I am having a problem with is as follows:
Code:
void add(string names[], int numbers[], int& counter)
{
counter++;
cout << "Enter the name: ";
cin >> names[counter];
cout << "Enter the CWID: ";
cin >> numbers[counter];
}
It compiles fine, but when I run the program Visual Studio gives me this error: "Unhandled exception at 0x10489a8c (msvcp80d.dll) in 456.exe: 0xC0000005: Access violation reading location 0x99ac8c80."
Frankly I have no Idea what this means lol. Could someone please inform me as to what I am doing wrong? I am sure it is obvious but I am pretty new to this stuff so any help would be greatly appreciated, thanks.