cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
ascii code
ascii code
Apr 6, 2017 at 2:19pm
Apr 6, 2017 at 2:19pm UTC
Jonh
(2)
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
Apr 6, 2017 at 2:55pm UTC
xxvms
(197)
Hi John
show us the code......
Apr 6, 2017 at 8:33pm
Apr 6, 2017 at 8:33pm UTC
Jonh
(2)
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.