2010-11-18 02:45:45 UTC
#include
#include
void translate_sentence (char *c)
{
char sentence[81];
char *psentence;
while (strchr("aeiouAEIOU",*c) == NULL) /*this checks for a vowel at the beginning of the words*/
{
char consonant = *c;
char to = *c, *from=c+1;
while (*from *to++ == *from++)
{
consonant = *to; /**Error 1 is this line**/
}
}
printf("%say", *c);
}
void main (void)
{
char sentence[81];
char *psentence;
/*Instructions to the user*/
printf("This program translates your sentence into pig latin.");
printf("Please type in a sentence or type stop: ");
gets (sentence);
printf("You typed in \n%s \n");
word = strtok(sentence, " "); /**Error 2 and Error 3 in this line**/
translate_sentence(word);
printf("\n");
}
error1: error C2100: illegal indirection
error2: error C2065: 'word' : undeclared identifier
error3: error C2440: '=' : cannot convert from 'char *' to 'int'