I'm new to C, but have been programming a couple of years. I've been getting some curious errors with this code and I just don't understand what's wrong.
Here are the errors:
seek_word.c:10:30: missing terminating " character
seek_word.c: In function `main':
seek_word.c:11: warning: comparison between pointer and integer
seek_word.c:11: error: parse error before "word"
seek_word.c: At top level:
seek_word.c:16: error: parse error before string constant
seek_word.c:16: warning: conflicting types for built-in function `printf'
seek_word.c:16: warning: data definition has no type or storage class
Here's the code:
#include <stdio.h>
int main() {
char * input;
char * word;
char * sentence;
printf(">> ");
scanf("%s", input);
int i;
for(i=0,word!="\n"",i++) {
word = input;
}
for(i,word!="\n",i++) {
sentence = input;
}
printf("word: %s.\nsentence: %s\n", *word, *sentence);
}
I'd really appreciate if someone could help me out.
Thanks,
inabox
Here are the errors:
seek_word.c:10:30: missing terminating " character
seek_word.c: In function `main':
seek_word.c:11: warning: comparison between pointer and integer
seek_word.c:11: error: parse error before "word"
seek_word.c: At top level:
seek_word.c:16: error: parse error before string constant
seek_word.c:16: warning: conflicting types for built-in function `printf'
seek_word.c:16: warning: data definition has no type or storage class
Here's the code:
#include <stdio.h>
int main() {
char * input;
char * word;
char * sentence;
printf(">> ");
scanf("%s", input);
int i;
for(i=0,word!="\n"",i++) {
word = input;
}
for(i,word!="\n",i++) {
sentence = input;
}
printf("word: %s.\nsentence: %s\n", *word, *sentence);
}
I'd really appreciate if someone could help me out.
Thanks,
inabox