hi,
new to C and working stuff out...
the following function is supposed to get a number of strings from user
however, the output is weird:
for the first value (i=0) it doesn't wait for input, but goes straight on to i=1.
Why? when i use scanf this works fine, only problem is i need to get whole sentence from user.
thanks
Code:
#include "targ46.h"
void GetSentence(int numOfSent,char dictionary[][MAX_WORD],
int duplicates[MAX_DICT])
{
int i;
char sentence[MAX_SENTENCE];
for (i=0; i<numOfSent;i++)
{
printf("Sentence %d:\n",i+1);
gets(sentence);
ProcessSentence(sentence,dictionary,duplicates);
}
}