reading strings with spaces
hi guys im having trouble allocating strings (with spaces) to an array and then printing them out to screen. here is an example prog that I created hopefully you can understand what im trying to do.
Code:
#include <stdio.h>
int main()
{
char *names[30];
fgets(&names[0],30,stdin);
fflush(stdin);
fgets(&names[1],30,stdin);
fflush(stdin);
printf("%s %s", &names[0], &names[1]);
return 0;
}
I want the program output to look like this
eldorado 09
eldorado 92
would appreciate the help thanx in advance.