🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #188

Re: HOW Convert char ("A") to Ascii (65) ?????

#188
From: Mark Blattner
Date: Mon, 23 Nov 1998 00:00
22 lines
1669 bytes
On Tue, 24 Nov 1998 00:13:15 -0000, "Wladimir Kopilevich"
<ctnkirk@cityweb.de> wrote:

>How can I convert a char/AnsiString character ("A") to a int ascii value
>(65) ?
>and 65 to "A" ?????

There isn't any difference between 'A' and 65.  They are completely
equivalent ways of expressing the same thing.  For instance:

char pS[] = "A";
char c = 'A';
int i = 65;

i = c;  /* i's value is still 65 */
i = pS[0]; /* i's value is still 65 */

c = 65; /* c is still 'A' */
pS[0] = 65; /* pS still contains "A" */

c = i; /* c is still 'A' */
pS[0] = i; /* array pS still contains "A" */
Technical Details
Message-ID: <3659f3a9.46677059@news.efortress.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <SXl62.903$081.6430@news2.cityweb.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11605a,c6c96de55a1b7d31,start
X-Google-Attributes: gid11605a,public
X-Google-Thread: f9701,c6c96de55a1b7d31,start
X-Google-Attributes: gidf9701,public
X-Google-Thread: fc8d0,c6c96de55a1b7d31,start
X-Google-Attributes: gidfc8d0,public
X-Google-Thread: 114592,c6c96de55a1b7d31,start
X-Google-Attributes: gid114592,public
X-Google-Thread: 10d4ba,c6c96de55a1b7d31,start
X-Google-Attributes: gid10d4ba,public
From: mark@digitalpla.net (Mark Blattner)
Subject: Re: HOW Convert char ("A") to Ascii (65) ?????
Date: 1998/11/23
Message-ID: <3659f3a9.46677059@news.efortress.com>
X-Deja-AN: 414974544
References: <SXl62.903$081.6430@news2.cityweb.de>
X-Trace: news14.ispnews.com 911865164 204.164.171.7 (Mon, 23 Nov 1998 18:52:44 EDT)
Organization: Foxware Inc.
Reply-To: mark@digitalpla.net
NNTP-Posting-Date: Mon, 23 Nov 1998 18:52:44 EDT
Newsgroups: alt.comp.lang.learn.c-c++,alt.winsock.programming,att.lang.c++,borland.public.cppbuilder.activex,borland.public.cppbuilder.commandlinetools