ascii code

Apr 6, 2017 at 2:19pm
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?
Apr 6, 2017 at 2:55pm
Hi John

show us the code......
Apr 6, 2017 at 8:33pm
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.