I am now learning the pointer and memory section of C. Now I am stuck on this code. I am not understanding how this code process and how the code shows result contestants[2] = 2
. Please consider me as a very new learner and answer briefly how a single code worked and how's the result 2?
#include <stdio.h>
int main()
{
int contestants[] = {1, 2, 3};
int *choice = contestants;
contestants[0] = 2;
contestants[1] = contestants[2];
contestants[2] = *choice;
printf("I'm going to pick contestant number %i\n", contestants[2]); return 0;
}