Frankly speaking, i find your answer as a sarcastic one (at a first glance)
Though, it gave me a (indirect) help.
I will finish correcting my errors as early as possible then if i find something weird, i am going to post the main part which i am confused with. Is that better enough?
ok, question.
Code:
int n, z;
n=rand();
srand((unsigned int)time(0));
n=rand()%z;
printf("Please choose a category. Press:\n");
printf("1 --> Food Trip!\n");
printf("2 --> Phrase/Quotes anyone?\n");
printf("Category No:");
scanf("%d", &categoryno);
if (categoryno == 1)
{
strcpy(Salita[1].Word, "Mcdonald's\0");
strcpy(Salita[0].Word, "Food Stalls\0");
strcpy(Salita[2].Word, "Banana\0");
}
else if (categoryno == 2)
{
strcpy(Salita[1].Word, "You never know what you have till you lose it. You never get it back./n -snatcher/0");
strcpy(Salita[2].Word, "Beware, so long as you live, of judging men by their outward appearance.\n -Jean de La Fontaine\0");
strcpy(Salita[0].Word, "Curiosity. The reason why most of us haven't commited suiucide long ago.\n -Anonymous\0");
}
I checked my code if this is working (via printf("%s")). and I noticed that it prints twice. Why is that so?