title: Infix to postfix conversion using stacks (linked lists) in C++
body: <p>Good day, everyone! I'm new in C++ (and here in stackoverflow as well) and I need help from you experts. There's something wrong with this code even if there is no error or warning. It just hangs whenever the program is being executed. <br><br>
  The program converts infix to postfix using linked lists (stacks).</p>
  
  <pre><code># include &lt;iostream&gt;
  # include &lt;cstring&gt;
  
   using namespace std;
  
   struct node {
      char data;
      node *next;
   };
  
   node *top=NULL;
   node *bottom=NULL;
   node *entry;
   node *last_entry;
   node *second_last_entry;
  
   void push(const char Symbol) {
      entry=new node;
      if(bottom==NULL) {
           entry-&gt;data=Symbol;
           entry-&gt;next=NULL;
           bottom=entry;
           top=entry;
      }
      else {
           entry-&gt;data=Symbol;
           entry-&gt;next=NULL;
           top-&gt;next=entry;
           top=entry;
      }
  }
  
  const char pop( ) {
      char Symbol=NULL;
  
      if(bottom==NULL)
          cout&lt;&lt;"\n\n\n\t ***  Error : Stack is empty. \n"&lt;&lt;endl;
  
      else {
          for (last_entry=bottom; last_entry-&gt;next!=NULL; last_entry=last_entry-&gt;next)
              second_last_entry=last_entry;
  
          if(top==bottom)
          bottom=NULL;
  
          Symbol=top-&gt;data;
  
          delete top;
  
          top=second_last_entry;
          top-&gt;next=NULL;
      }
  
      return Symbol;
  }
  
  void infix_to_postfix(const char *Infix) {
      char Infix_expression[100]={NULL};
      char Postfix_expression[100]={NULL};
  
      strcpy(Infix_expression,"(");
      strcat(Infix_expression,Infix);
      strcat(Infix_expression,")");
  
      char Symbol[5]={NULL};
      char Temp[5]={NULL};
  
      for(int count=0;count&lt;strlen(Infix_expression);count++) {
          Symbol[0]=Infix_expression[count];
  
          if(Symbol[0]=='(')
              push(Symbol[0]);
  
          else if(Symbol[0]==')') {
             Symbol[0]=pop( );
  
             while(Symbol[0]!='(')
                {
               strcat(Postfix_expression,Symbol);
  
               Symbol[0]=pop( );
                }
          }
  
           else if(Symbol[0]=='^' || Symbol[0]=='*' || Symbol[0]=='/'
                      || Symbol[0]=='+' || Symbol[0]=='-')
          {
             if(Symbol[0]=='*' || Symbol[0]=='/')
                {
               Temp[0]=pop( );
  
               while(Temp[0]=='^' || Temp[0]=='*' || Temp[0]=='/')
                  {
                     strcat(Postfix_expression,Temp);
  
                     Temp[0]=pop( );
                  }
  
               push(Temp[0]);
                }
  
             else if(Symbol[0]=='+' || Symbol[0]=='-')
                {
               Temp[0]=pop( );
  
               while(Temp[0]!='(')
                  {
                     strcat(Postfix_expression,Temp);
  
                     Temp[0]=pop( );
                  }
  
               push(Temp[0]);
                }
  
             push(Symbol[0]);
          }
  
           else
          strcat(Postfix_expression,Symbol);
        }
  
         cout&lt;&lt;"\n\n Postfix Expression : "&lt;&lt;Postfix_expression;
  }
  
   int main( ) {
      char Infix_expression[100]={NULL};
      cout&lt;&lt;"\n\n Enter the Infix Expression : ";
      cin&gt;&gt;Infix_expression;
      infix_to_postfix(Infix_expression);
      return 0;
  }
  </code></pre>
  
  <p>Please help me! I'm a newbie and I can't go far without you guys. Thank you very much!</p>