-
Converting ascii to associated character string
Can anybody show me how to convert an ascii number to its associated character
string?
i.e. 64 = 'A'
-
Re: Converting ascii to associated character string
just cast the int value to char i.e
char a = (char)64;
"CeeCee" <cndeecee@excite.com> wrote:
>
>Can anybody show me how to convert an ascii number to its associated character
>string?
>
>i.e. 64 = 'A'
>
-
Re: Converting ascii to associated character string
they are the same thing. a char is an integer from 0 - 255. putting the ints
into a string and printing it will work.
char x = 64;
cout x will print 'A' for you.
remember to end the string with (int)0 in the last element...
"CeeCee" <cndeecee@excite.com> wrote:
>
>Can anybody show me how to convert an ascii number to its associated character
>string?
>
>i.e. 64 = 'A'
>
-
Re: Converting ascii to associated character string
"CeeCee" <cndeecee@excite.com> wrote:
>
>Can anybody show me how to convert an ascii number to its associated character
>string?
>
>i.e. 64 = 'A'
>
Try
#include <iostream.h>
void main()
{
cout<< char(65);
while(cin.get()!='\n');
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks