I want to get string elements with space. Let's say I have a string called test and user will enter something in every cell, for instance he will enter colors he will enter the colors in a single line like; Green Yellow Blue Black - then he will press enter then program take everything until the space entered and put it on the first element of string then continues. In this case the string should be according to;
test[0] "Green"
test[1] "Yellow"
test[2] "Blue"
test[3] "Black"
I have tried to write it with 2 nested loops but I couldn't manage to get strings with space
long i
char* test[4]
printf("Enter your guess:\n");
for(i=0;i<5;i++)
{
while(test[i]!=" ")
{
scanf("%s", test[i]);
}
}