DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    CeeCee Guest

    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'


  2. #2
    Ako Guest

    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'
    >



  3. #3
    jonnin Guest

    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'
    >




  4. #4
    NA NA Guest

    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');
    }



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links