The first program below is utilizing a pointer for the array movie
:
#include <stdio.h>
int main(void) {
char movie [20];
char * pMovie = movie;
fgets(pMovie, 20, stdin);
puts(pMovie);
return 0;
}
While the second program below is not utilizing any pointer and essentially achieves the same outcome. I am not understanding the benefit that the teacher is trying to show with using pointers within the pointer but I can assume that it goes beyond this particular example:
#include <stdio.h>
int main(void) {
char movie [20];
fgets(movie, 20, stdin);
puts(movie);
return 0;
}