fork download
  1. char str[80];
  2. char token[80];
  3. printf("Enter words\n");
  4. fgets(str,80,stdin);
  5. char *p, *q;
  6. p = str;
  7. while (*p) {
  8. q = token;
  9. while (*p != ‘ ‘ && *p){
  10. *q = *p;
  11. q++; p++;
  12. }
  13. if (*p) p++;
  14. *q = ‘\0;
  15. printf("%s\n", token);
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:8: error: expected declaration specifiers or '...' before string constant
 printf("Enter words\n");
        ^
prog.c:4:11: error: expected ')' before numeric constant
 fgets(str,80,stdin);
           ^
prog.c:6:1: warning: data definition has no type or storage class
 p = str;
 ^
prog.c:6:1: warning: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
prog.c:6:1: error: conflicting types for 'p'
prog.c:5:7: note: previous declaration of 'p' was here
 char *p, *q;
       ^
prog.c:6:5: warning: initialization makes integer from pointer without a cast
 p = str;
     ^
prog.c:7:1: error: expected identifier or '(' before 'while'
 while (*p) {
 ^
prog.c:9:3: error: stray '\342' in program
   while (*p != ‘  ‘ && *p){
   ^
prog.c:9:3: error: stray '\200' in program
prog.c:9:3: error: stray '\230' in program
prog.c:9:3: error: stray '\342' in program
prog.c:9:3: error: stray '\200' in program
prog.c:9:3: error: stray '\230' in program
prog.c:14:4: error: stray '\342' in program
    *q = ‘\0’;
    ^
prog.c:14:4: error: stray '\200' in program
prog.c:14:4: error: stray '\230' in program
prog.c:14:4: error: stray '\' in program
prog.c:14:4: error: stray '\342' in program
prog.c:14:4: error: stray '\200' in program
prog.c:14:4: error: stray '\231' in program
stdout
Standard output is empty