So I have this code
int *userInput; //array place holder
//int max; //Max variable for later use in comparisons
int start = 0; //inital starting point value for loops
int endUserInput; //used to find the total number input
printf("You may enter up to a max of 50 integer values, Please enter the first value: ");
//loop collects the user inputs
/* Using a while loop to check for data to be true in what is entered
to spot when the data becomes false when a letter is entered*/
while (scanf("%d", &userInput[start]) == 1) {
//If statement entered to catch when the total is met
if (start == 49) {
break;
}
start = start + 1;
//Print statement to let user know what value they are at and how to end input
printf("Enter next value %d or enter C to calculate: ", start + 1);
}
It runs on my MBP compiler but on Dev on a PC it crashes with memory error?
the error being int *userInput declaration. What can I do to fix this without assigning specifics to the array.
userInput.