From: matthew_heaney@acm.org (Matthew Heaney)
Subject: Re: char -> int
Date: 1998/11/22
Date: 1998-11-22T00:00:00+00:00 [thread overview]
Message-ID: <matthew_heaney-ya023680002111981909380001@news.ni.net> (raw)
In-Reply-To: 72vgp5$u9g$1@news02.btx.dtag.de
In article <72vgp5$u9g$1@news02.btx.dtag.de>, Juergen.Pfeifer@t-online.de
(Juergen Pfeifer) wrote:
>alex wrote:
>>
>> How do I cast char to an int using ada?
Use the attribute Character'Pos, as in:
I : Integer := Character'Pos ('m');
Of course, you can always use Unchecked_Conversion:
function To_Int is
new Unchecked_Conversion (Character, Interfaces.Integer_8);
I : Integer_8 := To_Int ('m');
next prev parent reply other threads:[~1998-11-22 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-18 0:00 char -> int alex
1998-11-18 0:00 ` Niklas Holsti
1998-11-18 0:00 ` Juergen Pfeifer
1998-11-22 0:00 ` Matthew Heaney [this message]
1998-11-24 0:00 ` John McCabe
1998-11-18 0:00 ` Pascal Obry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox