🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12162

Re: char to byte value?

#12162
From: Remy Lebeau (TeamB)
Date: Tue, 23 Dec 2003 23:28
22 lines
1300 bytes
"Muzzy" <leyandrew@yahoo.com> wrote in message
news:3fe8ca47$1@newsgroups.borland.com...

> I can't seem to find how to get ASCII values of characters
> and reverse in c++.

A 'char' already contains its ASCII value.  Just assign 'char' to 'int' and
vice versa, ie:

    char c = 'A'
    int i = c;

    i = 75;
    c = i;

> in pascal it's "chr" and "ord"...

Those are unnecessary in C++.


Gambit
Technical Details
Message-ID: <3fe8ce6c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fe8ca47$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,48d04663a6a1b1c6
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-23 15:39:56 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fe8ca47$1@newsgroups.borland.com>
Subject: Re: char to byte value?
Date: Tue, 23 Dec 2003 15:28:34 -0800
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.139.199
Message-ID: <3fe8ce6c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1072221804 67.22.139.199 (23 Dec 2003 15:23:24 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail