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-Language: ENGLISH,ASCII X-Google-Thread: 103376,51e0e3232c45c76c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-18 10:24:31 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: converting - adasockets Date: 18 Jun 2001 13:13:49 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <20010611.085009.1789366143.627@zamek.gda.pl> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: skates.gsfc.nasa.gov 992885375 7614 128.183.220.71 (18 Jun 2001 17:29:35 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 18 Jun 2001 17:29:35 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 Xref: archiver1.google.com comp.lang.ada:8859 Date: 2001-06-18T17:29:35+00:00 List-Id: "Micha� Nowikowski" writes: > Hello > > Im writting a program which reads some data from a socket > (i used adasockets). And i've problem with converting > this date from String to fg Integer. How could i do that. > In C it woul look like: > > char s[10]; > int i; > > i = *(int*)s; > > but in Ada? I have not seen AdaSockets, but I assume it returns data as a 'Stream', not a 'String' (otherwise it's not Real Ada). So you want to use Integer'read. However, you should not be using type Integer, since the compiler does not guarrantee it has the same size on both ends of the socket. You should use your own integer type, with a specified size, or one of the ones in package Interface. -- -- Stephe