Symbol balancing

I write a programme for symbol balancing but there is problem with this... anyone to help!
plz comment....

MAIN FILE

#include <iostream>
#include "Stacks.h"

using namespace std;

int main()
{
StackList s;
char c[] = "[({})]";
int i = 0;
while(c[i]=='\0'){
if((c[i]=="(")||(c[i]=="{")||(c[i]=="[")){
s.Push(c[i]);
}
else if(c[i]==")") {
if ((s.isEmpty())||(s.Top()!="("))
cout<<"Missing opening parentheses"<<endl;
s.Pop();
}
else if(c[i]=="}") {
if ((s.isEmpty())||(s.Top()!="{"))
cout<<"Missing opening curly braces"<<endl;
s.Pop();
}
else if(c[i]=="]") {
if ((s.isEmpty())||(s.Top()!="["))
cout<<"Missing opening square brackets"<<endl;
s.Pop();
}
i--;
}

if (!s.isEmpty()){
cout<<"Missing closing character"<<endl;
}

return 0;
}

HEADER FILE

#ifndef STACKS_H_INCLUDED
#define STACKS_H_INCLUDED

class Node{
public:
Node(char);
private:
char data;
Node* next;
friend class StackList;
};
class StackList{
public:
StackList();
void Push(char);
char Pop();
bool isEmpty();
char Top();
private:
Node* head;
Node* tail;
};

#endif // STACKS_H_INCLUDED

CPP FILE

#include <iostream>
#include "Stacks.h"

using namespace std;

Node::Node(char d){
data = d;
next = NULL;
}

StackList::StackList(){
head = NULL;
tail = NULL;
}

void StackList::Push(char d){
Node* n = new Node(d);
if(head==NULL){
head = n;
tail = n;
}
else {
n->next = head;
head = n;
}
}
char StackList::Pop(){
if(isEmpty()){
return NULL;
}
else {
Node* temp;
temp = head;
head = head->next;
delete temp;
return head->data;
}
}
char StackList::Top(){
return head->data;
}

bool StackList::isEmpty(){
return (head==NULL)? true: false;
}
Topic archived. No new replies allowed.