#include<iostream.h>
#include<string.h>
struct node
{
	node*next;
	int data;
};
class stack
{
private:node*top;node*top2;char c;
public:
	stack()
	{
		top=NULL;
		top2=NULL;
	}
	void push(char c)
	{
		if(top==NULL)
		{
			top=new node;
			top->data=c;
			top->next=NULL;
		}
		else
		{
			node*temp=top;
			temp->data=c;
			temp->next=top;
			top=temp;
		}
	}
	void pop()
	{
		node*temp=top;
		char x=temp->data;
		cout<<x;
		top=top->next;
		delete temp;
	}
};
void main()
{
	stack a;
	char f[10];
	cout<<"enter"<<endl;
	cin>>f;
	for(int i=0;i<10;i++)
	{
		a.push(f[i]);
	}
	for(int j=0;j<10;j++)
{
a.pop();
}
}

One thing to consider:

else
{
	node*temp=top;

 } //where is temp at this point?  nowhere it's been destroyed

Small(er) stuff:
It should be #include <iostream> and #include <string> (the latter of which you don't really use in your program).
You need using namespace std; (or better yet using std::cout; using std::endl; , or qualify them with std:: in the body of your code).
Change data to char in your struct, have main returning an int (and then return one) and look into cin.get() (see here for a reference).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.