title: What does it mean by too few arguments to function 'addBook'?
body: <blockquote>
  <p>I'm basically trying to add a book into my libraryy.txt file my problem is the compiler says that there's too few arguments to perform the addBook() function, what should I include in the addBook() function parentheses in my main function?</p>
  </blockquote>
  <pre><code>struct book{
           char *title;
           char *author;
           char *subject;
  };
  
  struct library {
      struct book collection;
      int num_books;
      struct library *next;
  };
  </code></pre>
  <p>This is my addBook() function:</p>
  <pre><code>void addBook(struct library* thislib){
  FILE *cfPtr;
  cfPtr = fopen(&quot;libraryy.txt&quot;, &quot;a&quot;);
  char strtitle[MAX];
  char strauthor[MAX];
  char strsubject[MAX];
  int operation;
  struct library acollection;
          printf(&quot;Title: &quot;);
          scanf(&quot;%s&quot;, strtitle); 
          printf(&quot;Author: &quot;);
          scanf(&quot;%s&quot;, strauthor);
          printf(&quot;Subject: &quot;);
          scanf(&quot;%s&quot;, strsubject);
          thislib-&gt;collection.title = strtitle;
          thislib-&gt;collection.author = strauthor;
          thislib-&gt;collection.subject = strsubject;
          printf(&quot;The book %s author %s subject %s has been added to the library.\n&quot;, thislib-&gt;collection.title, thislib-&gt;collection.author, thislib-&gt;collection.subject);
  
         fprintf(cfPtr, &quot;%d %s %s %s\n&quot;, operation, collection.title, collection.author, collection.subject);
  
  }
  </code></pre>
  <blockquote>
  <p>The compiler is telling me that there are too few arguments to perform function addBook..what should I add in the parentheses for addBook?? The error is in my main method below:</p>
  </blockquote>
  <pre><code> FILE *cfPtr;
  int operation;
  
  
  
   if ((cfPtr = fopen(&quot;libraryy.txt&quot;,&quot;a&quot;)) == NULL){
          printf(&quot;File could not be opened...\n&quot;);
      }
  
     else {
  
  
          while(1){
          operate();
          printf(&quot;Enter an operation: &quot;);
          scanf(&quot;%d&quot;, &amp;operation);
  
          switch(operation){
              case 1:
              addBook(); //it basically gave me the error here which is 'too few arguments to perform function addBook'
             break;
  </code></pre>
  <blockquote>
  <p>Don't get me wrong, I know what does too few arguments/no arguments mean but what should I include in those parentheses as arguments? :&quot;) Need some help.</p>
  </blockquote>