title: cannot convert FILE* -C++
body: <p>I've been asked to make a program for my university course and it needs to check how many open and closed brackets are in a file. I am getting two error messages for my function:</p>
  
  <blockquote>
    <p>40:22: cannot convert FILE* {aka_IO_FILE*} to 'const char*' for argument '1' FILE*<br>
    fpin = fopen(fpin);<br>
    42:22: warning format '%s' expects argument of type 'char*', but argument 2 has type 'int'<br>
    printf("Could not open %s \n", arr[1]);</p>
  </blockquote>
  
  <pre><code>void countBrackets(char arr[])
  {
      int bracketCount = 0:
      int lineNumber = 0;
      //tracking position in file 
      FILE* fpin;
      //open file and check to make sure 
      //file opened safley
      fpin = fopen(fpin);
      if (fpin == NULL){
          printf("Could not open %s \n", arr[1]);
          return;
      }
      //Count how many opened and closed { and } brackets are 
      //in the file
      for ( char currCh = 0; currCh &gt; lineNumber; currCh ++){
          if (currCh == '{') {
              bracketCount ++;
          }else if (currCh == '}') {
              bracketCount ++;
          }else (currCh == '\n') {
              lineNumber ++;
          }
          //display error messages for the user
          if (bracketCount &lt; 0) {
              printf("there is more closing brackets than opening\n");
          }else{
              printf("There is more opening brackets than closing\n");
          }
      }
      fclose(fpin);
  }
  </code></pre>