So I have a program that needs to increment the value in the first array, in whatever position is set by the second array.
i.e: A user enters the number 5 into an array. The program then goes to that position (5) in the second array and increments it's value by one. So far the code works fine, but I have to use Pointer notation and not Subscript, and am struggling with the correct syntax. Here's the code:
void enter_into_frequency(int *frequency_temp, int *user_numbers_temp)
{
int i;
for(i=0; i<NO_OF_NUMS; i++)
{
//Frequency array, with position as whatever number the user entered
frequency_temp[user_numbers_temp[i]]++; //Need this in pointer notation
}
}