Language: C

#include <string.h>

char buff[1000];


int compare (char *str )
{
  bool end1 = false;
  int n = 0;

  while( end1 ){
    if ( buff[n] == “s” ){
      buff[n] = “e”;
      buff[n+1] = “s”;
      end1 = true;
    } else {
      buff[n+1]=“s”;      
    }
    n++;
  }

}
int main(void)
{
  scanf(“&buff”, %s);   //input 
  compare( &buff );
  return 0;
}


Compiler output:
main.c: In function 'compare':
main.c:8:3: error: unknown type name 'bool'
    8 |   bool end1 = false;
      |   ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <string.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:8:15: error: 'false' undeclared (first use in this function)
    8 |   bool end1 = false;
      |               ^~~~~
main.c:8:15: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:21: error: stray '\342' in program
   12 |     if ( buff[n] == <U+201C>s<U+201D> ){
      |                     ^~~~~~~~
main.c:12:23: error: stray '\342' in program
   12 |     if ( buff[n] == <U+201C>s<U+201D> ){
      |                              ^~~~~~~~
main.c:12:22: error: 's' undeclared (first use in this function)
   12 |     if ( buff[n] == “s” ){
      |                      ^
main.c:13:17: error: stray '\342' in program
   13 |       buff[n] = <U+201C>e<U+201D>;
      |                 ^~~~~~~~
main.c:13:19: error: stray '\342' in program
   13 |       buff[n] = <U+201C>e<U+201D>;
      |                          ^~~~~~~~
main.c:13:18: error: 'e' undeclared (first use in this function)
   13 |       buff[n] = “e”;
      |                  ^
main.c:14:19: error: stray '\342' in program
   14 |       buff[n+1] = <U+201C>s<U+201D>;
      |                   ^~~~~~~~
main.c:14:21: error: stray '\342' in program
   14 |       buff[n+1] = <U+201C>s<U+201D>;
      |                            ^~~~~~~~
main.c:15:14: error: 'true' undeclared (first use in this function)
   15 |       end1 = true;
      |              ^~~~
main.c:15:14: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:17:17: error: stray '\342' in program
   17 |       buff[n+1]=<U+201C>s<U+201D>;
      |                 ^~~~~~~~
main.c:17:19: error: stray '\342' in program
   17 |       buff[n+1]=<U+201C>s<U+201D>;
      |                          ^~~~~~~~
main.c: In function 'main':
main.c:25:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   25 |   scanf(“&buff”, %s);   //input
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <string.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:25:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   25 |   scanf(“&buff”, %s);   //input
      |   ^~~~~
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:9: error: stray '\342' in program
   25 |   scanf(<U+201C>&buff<U+201D>, %s);   //input
      |         ^~~~~~~~
main.c:25:15: error: stray '\342' in program
   25 |   scanf(<U+201C>&buff<U+201D>, %s);   //input
      |                      ^~~~~~~~
main.c:25:18: error: expected expression before '%' token
   25 |   scanf(“&buff”, %s);   //input
      |                  ^
main.c:25:10: error: passing argument 1 of 'scanf' from incompatible pointer type [-Wincompatible-pointer-types]
   25 |   scanf(“&buff”, %s);   //input
      |          ^~~~~
      |          |
      |          char (*)[1000]
main.c:25:10: note: expected 'const char *' but argument is of type 'char (*)[1000]'
main.c:26:12: error: passing argument 1 of 'compare' from incompatible pointer type [-Wincompatible-pointer-types]
   26 |   compare( &buff );
      |            ^~~~~
      |            |
      |            char (*)[1000]
main.c:6:20: note: expected 'char *' but argument is of type 'char (*)[1000]'
    6 | int compare (char *str )
      |              ~~~~~~^~~