I have a simple question. Below I have typed a program that prompts one to input their name and the program then prints out their name. The program works fine if you enter just a first name. If you press space and enter your last name as well the program doesn't work. Why?
Here's the code:
Code:#include <stdio.h> #include <string.h> int main() { char *name[125]; printf("Please enter your name: "); scanf("%s", &name); printf("Your name is %s ", name); getchar(); getchar(); }