title: %s is skipping the entire print line - no user input
body: <p>What's wrong in my code? I successfully created a tree and everything is working fine except <code>printInorder</code> function and print statement in <code>void main</code>. When I try to print with <code>%s</code> its skipping the entire line.</p>
  <p>Can you please help me in resolving this? I even tried <code>fflush</code> but it doesn't help me in my case and I don't try any <code>scanf</code> statement in my code.</p>
  <pre><code>struct Tree
  {
      char data[10];
      struct Tree *left;
      struct Tree *right;
  } * root;
  
  struct Tree *createNode(char data[])
  {
      struct Tree *node = malloc(sizeof(struct Tree));
      strcpy(node-&gt;data, data);
      node-&gt;left = node-&gt;right = NULL;
      insertTree(node, root, data);
  }
  void insertTree(struct Tree *currentNode, struct Tree *temp, char data[])
  {
      char fletter=data[0];
      if (fletter=='a'||fletter=='e'||fletter=='o'||fletter=='i'||fletter=='u')
      {
          if (root == NULL)
          {
              root = currentNode;
              printf(&quot;inserted at root&quot;);
          }
          else if (temp-&gt;left == NULL)
          {
              temp-&gt;left = currentNode;
              printf(&quot;data inserted successfully at left&quot;);
          }
          else
          {
              insertTree(currentNode, temp-&gt;left,data);
          }
      }
  
      else
      {
           if (root == NULL)
          {
              root = currentNode;
              printf(&quot;inserted at root&quot;);
          }
          else if (temp-&gt;right == NULL)
          {
              temp-&gt;right = currentNode;
              printf(&quot;data inserted successfully at right&quot;);
          }
          else
          {
              insertTree(currentNode, temp-&gt;right,data);
          }
      }
  }
  void printInorder(struct Tree *tmp) 
  { 
       if (tmp == NULL) 
            return; 
       printInorder(tmp-&gt;left); 
       printf(&quot;%s &quot;,tmp-&gt;data);   
       printInorder(tmp-&gt;right); 
  } 
    
  
  void main()
  {
      struct Tree *root = createNode(&quot;saish&quot;);
      struct Tree *d1 = createNode(&quot;ansha&quot;);
      struct Tree *d2 = createNode(&quot;shish&quot;);
  printf(&quot;%s&quot;,root-&gt;data);
      printInorder(root);
  }
  </code></pre>