title: expected specific-qualifier-list before 'function' and expected '=', ',', ';', 'asm' or '__attribute__' before 'function'
body: <p>I am programming in Objective-C but I would like to write a c function to increase the performance.  I have written the code below this post but the compile keeps coming back with the following error:</p>
  
  <blockquote>
    <p>error: expected specific-qualifier-list before 'bool'</p>
    
    <p>error: expected '=', ',', ';', 'asm' or '<strong>attribute</strong>' before 'addToBoolArray'</p>
  </blockquote>
  
  <p>structs.h:</p>
  
  <pre><code>typedef struct boolArray{
  bool *array;
  int count;
  } boolArray;
  
  bool addToBoolArray(boolArray *bArray, bool newBool)
  </code></pre>
  
  <p>structs.c:</p>
  
  <pre><code>#import "structs.h"
  
  bool addToBoolArray(boolArray *bArray, bool newBool)
  {
  if(bArray-&gt;count &gt; 0){
      bArray-&gt;array = realloc(bArray-&gt;array,(bArray-&gt;count+1)*sizeof(bool));
  else{
      bArray-&gt;array = (bool *)malloc(sizeof(bool));
  }
  
  if(bArray-&gt;array == NULL)
      return false;
  
  bArray-&gt;array[bArray-&gt;count] = newBool;
  bArray-&gt;count++;
  
  return true;
  }
  </code></pre>
  
  <p>I've found many forum threads about this error but none of them seem to address my issue.  Any ideas?</p>
  
  <p>Thank you </p>