You probably want something similar to this:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char array[3][10]; // array of 3 strings of at most 9 chars
scanf("%s", array[0]);
scanf("%s", array[1]);
printf("%s\n%s\n", array[0], array[1]);
return 0;
}
Or by allocating memory dynamically:
int main() {
char *array[3];
array[0] = (char*)malloc(10); // allocate space for a string of maximum 9 chars
array[1] = (char*)malloc(10); // allocate space for a string of maximum 9 chars
// beware: array[2] has not been initialized here and thus cannot be used
scanf("%s", array[0]);
scanf("%s", array[1]);
printf("%s\n%s\n", array[0], array[1]);
return 0;
}
Disclaimer: there is absolutely no error checking done here, for brevity. If you enter a string of more than 9 characters, the behaviour of this program will be undefined.
Anticipating the next question: inspite of reserving space for 10 chars we can only store string of maximum length of 9 chars because we need one char for the NUL
string terminator.