Don't get confuzzled by all this "pointer" talk.
The name of the array, is ALMOST a constant pointer to the first element of the array, and that is how arrays are commonly passed to functions:
Code:
#include <stdio.h>
#include <string.h>
void printIt(char *myname);
int main(void) {
char myname[] = "Rick";
printIt(myname); //"myname is the "pointer"
//other stuff here
return 0;
}
void printIt(char *myname) {
printf("\nMy name is: %s\n", *myname);
}
So, what have you been studying for user input of a string, which includes a space, and does not include a newline char?