M
masso600
char word[50];
in = fopen("test.txt", "r");
while(fscanf(in,"%s",&word)!=EOF)
{
/* Print all words */
/* printf("%s\n",&word); */
/* What I want to do: Process all words, somethink like: */
process_word(word);
/* This format works passing parameters */
/* process_word("test"); */
}
Well this does not work, I cant get word-variable to function in right
format. How do I pass word-variable to function process_word().
I have tried:
process_word(word[50]);
process_word(&word);
process_word(*word);
process_word(word);
Function:
void processword(char input[50]);
So process_word("test"); to processword(char input[50]); works but
process_word(&word); to processword(char input[50]); is not working,
how to change the syntax to make it work.
in = fopen("test.txt", "r");
while(fscanf(in,"%s",&word)!=EOF)
{
/* Print all words */
/* printf("%s\n",&word); */
/* What I want to do: Process all words, somethink like: */
process_word(word);
/* This format works passing parameters */
/* process_word("test"); */
}
Well this does not work, I cant get word-variable to function in right
format. How do I pass word-variable to function process_word().
I have tried:
process_word(word[50]);
process_word(&word);
process_word(*word);
process_word(word);
Function:
void processword(char input[50]);
So process_word("test"); to processword(char input[50]); works but
process_word(&word); to processword(char input[50]); is not working,
how to change the syntax to make it work.