Hi, can some one please have a look at my code for the user to enter integers and display it back to him.
For some reason my program can not accept more than 8 integers?
I wrote this program for a class assighnment where we where suppose to ask the user what size the array should be and of what type it should be and then he must enter the varaibles he requested in the array and it must be displayed back to him.
After stripping everything out to only this fixed int array I got the following error after entering the 9th integer: "The application was unable to start correctly (0xc0000142). Click OK to close the application."
Please help...
#include <iostream>
using namespace std;
int main()
{
int intArray[100];
int arrayPosition=0,userInput=0;
cout<<"Enter 10 integers."<<endl;
while(arrayPosition<10)
{
cin>>userInput;
intArray[arrayPosition]=userInput;
arrayPosition++;
}
arrayPosition=0;
while(arrayPosition<10)
{
cout<<intArray[arrayPosition]<<" ";
arrayPosition++;
}
return 0;
}
Thanks