title: expected identifier or ‘(’ before ‘/’ token
body: <p>I wrote the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt; 
  //To use fgets and printf I need to include stdio header
  
  #include &lt;string.h&gt;
  //To use strlen I need to include string header
  
  #define MAXLINE 100 /* maximum input line length */
  
  int suffix(char str[], char c);
  
  /*
    The function suffix prints all the substrings that 
    (1) starts with the letter stored in the variable 'c' 
    (2) included in the string str[]
  
    Function should return the number of substrings.
  
   */
  
  
  int main()
  {
      char user_input[MAXLINE]; /* current input line */
      char ch = 0;
      int counter = 0;
  
  
      printf(" Please enter a string (up to 100 characters) and then press enter ");
  
      /*
      This will store a maximum of MAXLINE characters into the string from the standard input 
      and it will ensure it is null-terminated. 
      The fact that we've limited the input to the size of the array declared earlier 
      ensures that there's no possibility of buffer overruns.
      */
      fgets(user_input, MAXLINE, stdin);
  
      //Then let's clear the pesky newline that's been entered into the string using strlen:
      user_input[strlen(user_input)-1] = '\0';
  
      printf(" Please enter a character and then press enter ");
      ch = getchar();
      while ( getchar() != '\n' );
  
      counter = suffix(user_input,ch);
  
      return 0;
  }
  
  
  
  int suffix(char str[], char c);
  {
    int i=0,j=0;
  
    for (i=0 ; (i &lt; MAXLINE-1) ; i++)
    {
      if (str[i] == c)
        for (j=i ; (j &lt; MAXLINE-1) ; j++)
      printf("%c", str[j]);
      count++;
      printf("\n");
    }
  
    return count;
  
  }
  </code></pre>
  
  <p>I also wrote the following make file:</p>
  
  <pre><code>mystr: my_str.o
      gcc -g -ansi -Wall my_str.o -o mystr
  
  my_str.o: my_str.c
      gcc -c -ansi -Wall my_str.c -o my_str.o
  </code></pre>
  
  <p>However, I get the following compilation errors:</p>
  
  <pre><code>VirtualBox:~/Desktop/Exercises/Assignments/my_str$ make
  gcc -c -ansi -Wall my_str.c -o my_str.o
  my_str.c:2:1: error: expected identifier or ‘(’ before ‘/’ token
  my_str.c:5:1: error: expected identifier or ‘(’ before ‘/’ token
  my_str.c: In function ‘main’:
  my_str.c:38:5: error: expected expression before ‘/’ token
  my_str.c:38:15: warning: character constant too long for its type [enabled by default]
  my_str.c:45:5: warning: implicit declaration of function ‘suffix’ [-Wimplicit-function-declaration]
  my_str.c:25:9: warning: variable ‘counter’ set but not used [-Wunused-but-set-variable]
  my_str.c: At top level:
  my_str.c:52:5: error: conflicting types for ‘suffix’
  my_str.c:52:1: note: an argument type that has a default promotion can’t match an empty parameter name list declaration
  my_str.c:45:15: note: previous implicit declaration of ‘suffix’ was here
  my_str.c:53:1: error: expected identifier or ‘(’ before ‘{’ token
  make: *** [my_str.o] Error 1
  VirtualBox:~/Desktop/Exercises/Assignments/my_str$ 
  </code></pre>
  
  <p>Please assist with "expected identifier or ‘(’ before ‘/’ token" error.</p>
  
  <p>Why conflicting types of suffix? why implicit declaration (each function in C must be declared at the beginning of the program so I it`s not clear to me what is wrong here)? </p>
  
  <p>Thanks</p>