I am attempting to store a string in a variable declared as char *name[2];
. I am using scanf()
to obtain the value from user input. This is my code so far and its currently not working:
#include <stdio.h>
#include <stdlib.h>
int main()
{ char *name[2];
scanf("%s",name[0]);
printf("%s",name[0]);
return 0;
}