ascii code

hi!
I have a text and I want to convert it to ascii code in c++. The program checks the allowed characters but does not convert the spaces. What can i do?
Hi John

show us the code......
char x;
if((x>='A' && x<='Z')||(x==' .')||(x==' ,')||(x==' '))
{
cout<<"Ascii Code: "<< int(x)<< endl;
}
else
{
cout<<" wrong character"<<endl;
continue;
}
Topic archived. No new replies allowed.