From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,826cd690cb6a7585 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!87.79.20.101.MISMATCH!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 30 Aug 2011 18:45:19 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Address and bit mask References: <904e717e-da4c-46c9-bbc2-4bae8368d459@l4g2000vbv.googlegroups.com> In-Reply-To: <904e717e-da4c-46c9-bbc2-4bae8368d459@l4g2000vbv.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4e5d139f$0$6575$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 30 Aug 2011 18:45:19 CEST NNTP-Posting-Host: 8666f82e.newsspool3.arcor-online.net X-Trace: DXC=^RT=a]3M\4fUoRk[hk2WalMcF=Q^Z^V3h4Fo<]lROoRa8kFjLh>_cHTX3jm^ZkeFhEOYob X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:21729 Date: 2011-08-30T18:45:19+02:00 List-Id: On 30.08.11 18:08, milouz wrote: > But, let me develop... > In C, it's rather easy to know how to do something because 1/ the > langage is so simple and 2/ there are some many helpful resources (The C language is perceivied to be simple, when it isn't: what's the C type of 60*60*24? How do size_t and unsigned long int differ? This is one reason why there are so many CVEs...) Ada learning material: http://www.it.bton.ac.uk/staff/je/adacraft/contents.htm http://www.adaic.org/learn/materials/ A K&R of Ada, with extensions for Ada 95 and Ada 2005: http://archive.adaic.com/standards/83rat/html/ratl-03.html http://www.adaic.org/resources/add_content/standards/95rat/rat95html/rat95-p1-2.html http://www.adaic.org/resources/add_content/standards/05rat/html/Rat-TTL.html An introduction for programmers: http://www.adaic.org/wp-content/uploads/2010/05/Ada-Distilled-10-Sept-2009.pdf > In Ada, I found nothing similar and even finding howto do a kind of > 'printf("%x"...)'... hum, sorry... displaying an Integer in hexa, is > difficult. How do you print an int in duodecimal (base 12) in C? :-) Base 16 and others in Ada: with Ada.Text_IO; procedure Int_Based is use Ada; package Duodec_IO is new Text_IO.Integer_IO (Natural); X : Natural := 123; begin Duodec_IO.Put (X, Base => 3); Duodec_IO.Put (X, Base => 8); Duodec_IO.Put (X, Base => 10); Duodec_IO.Put (X, Base => 12); Duodec_IO.Put (X, Base => 16); Text_IO.New_Line; end Int_Based;