title: I'm getting weird symbols in my output file instead of the appropriate letters
body: <p>I'm trying to print out a in order traversal of  BST to a output file. However, I get weird symbols sometimes instead of the stdin. </p>
  
  <p>I've tried allocating extra space for the char arr[] but it doesnt change anything.</p>
  
  <p>EDIT: I changed up the code and tried splitting it into two parts. One, where a method assigns each node to a node array in inlevel order and returns that array. And two, a different array that writes the returned values contents to a file. This time though I'm getting 2 errors.</p>
  
  <p>error: incompatible types when assigning to type ‘struct bstNode *’ from type ‘bstNode’
  error: incompatible types when assigning to type ‘struct bstNode *’ from type ‘bstNode’</p>
  
  <pre><code>void traverseTree(bstNode *root){
          FILE *file;
          file = fopen("newFile", "w");
          char *arr;
          arr = (char*)malloc(10000 * sizeof(char));
          if(root == NULL)
                  return;
  
          traverseTree(root-&gt;left);
          fgets(arr, 100, stdin);
          fprintf(file, arr);
          traverseTree(root-&gt;right);
  
  }
  </code></pre>
  
  <p>New code below</p>
  
  <pre><code>bstNode* traverseTree(bstNode *root, int i){
  
          bstNode *arr[100];
          if(root == NULL)
                  return;
  
          traverseTree(root-&gt;left, i);
  
          arr[i] = root;
          ++i;
          traverseTree(root-&gt;right, i);
  
   return *arr;
  }
  
  void writeToFile(bstNode *root, char *outputFileName){
          FILE *file;
          file = fopen("newFile", "w");
          bstNode *arr = traverseTree(root, 0);
          int i = 0;
          root = arr[i];
          while(root!= NULL){
          fprintf(file, root-&gt;data);
          ++i;
          root = arr[i];
          }
  
  }
  </code></pre>