im sorry..it slipped my mind that i should be doing it using a linked list implementation..
here is my try but there are too many errors:
Code:
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
#include<cstdlib>
#include <fstream>
using std::ifstream;
using std::ofstream;
#include"ItemType.h"
using namespace std;

class stack
{
private:
        NodeType* topPtr;
public:
	
	stack();
	void push(ItemType);
	int pop();
	bool isempty();
	bool isfull();
	void print();
	void print_reverse(stack);
	void reverse(Node*)
	void push(stack, int);
};

stack::stack()
{
	topPtr = NULL;
}
void stack::push(int ItemType newItem)
{
	NodeType*  location;
	location = new  NodeType;
	location->info = newItem;
	location->next = topPtr;
	topPtr = location;
}
int stack::pop()
{
	NodeType* tempPtr;
	tempPtr = topPtr;
	topPtr = topPtr ->next;
	delete tempPtr;
}
bool stack::isempty()
{
	return (topPtr == NULL);
}
bool stack::isfull()
{
	NodeType* location;
	location = new NodeType;
	if(location != null)
	{
		delete location;
		return false;
	}
	else
		return true;
}
void stack::print()
{
while(!isempty())
cout<<pop()<<endl;
}

void stack::print_reverse(stack st)
{
	if (ptr! =(node*) NULL)
		print_reverse(ptr->next)
		print ptr->info;
}

void stack::reverse(Node* head,){ 
Node* current = head; 
stack stk; 

while(current->next() != NULL){ 
stk.push(current);
current->next(); 
} 

head->next = NULL;
assign null to its next 
head = current;
the first node now 

while(current->next() != NULL) { 
Node* prevNode = stk.pop();
current->addLink(prevNode);
prevnode 
current = current->next();
} 
} 

int main()
{  
stack x;
int data;
ItemType item;

	ifstream instream; 
	ofstream outstream;
      
	instream.open("input.txt");
	outstream.open("output.txt");
	if(instream.fail()){
    	cout<<"Error opening file\n";
	exit(1);
	}

	while ( !instream.eof() )
	{	
		if (isfull())
			break;
		instream>> data;	
		item.Initialize(data);
		 int temp = item.getvalue();
		push(temp); 
		print();
		
	}
	instream.close();

	cout<<"--------\n";
	print_reverse(MAX_ITEMS);
	cin.get();
	outstream.close();
    return 0;
}
here is the ItemType.h
Code:
/* Information provided by the user */
const int MAX_ITEMS = 50;
struct NodeType{
	ItemType  info;
	NodeType* next;
};
class ItemType {
public:
	Stack();
	bool IsEmpty() const;
	bool IsFull() const;
	void Push(ItemType item);
	void Pop();
	ItemType Top() const;

private:
	NodeType* topPtr;

};