#include <iostream.h>
#include <conio.h>
class player{
public:
int pnum;
char pname[21];
char pposition;
int precord;
void read();
};//end of class player
void player::read()
{
cin>>pnum;
//when press space get pname
cin>>pname;
//when pree space gets pposition
cin>>pposition;
/*when press eneter goes to below syntaxes and prints them and space doesn't work*/
cout<<"\nplayer number:"<<pnum;
cout<<"\nplayer name:"<<pname;
cout<<"\nplayer position:"<<pposition;
}
void main()
{
player p1;
p1.read();
getch();
}
i want to use space buttom instead of enter in the place that i use enter how can i do that.