comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: ++ of C in ada
Date: Mon, 25 Jul 2005 05:55:23 GMT
Date: 2005-07-25T05:55:23+00:00	[thread overview]
Message-ID: <f9%Ee.7992$dU3.1257@newsread2.news.pas.earthlink.net> (raw)
In-Reply-To: <1122228917.377279.262690@g47g2000cwa.googlegroups.com>

nicolas.b wrote:
> How can i implement the operator ++ in ada :
> 
> type T_Ptr is access all T_Item;
> How can i implement : procedure Increment (Ptr : in out T_Ptr);

The fact that you're asking this indicates that you're at a stage in 
your exposure to Ada when you will probably have no need whatsoever for 
access types. Access types are rarely needed in Ada unless you're 
creating a dynamic data structure, and even then you don't need pointer 
arithmetic.

If you have some problem for which you think access types and pointer 
arithmetic are required, let us know what the problem is and I suspect 
we can show you why you're wrong, and what the Ada way is. In the 
extremely rare case that you're not wrong, we can show you what to do.

-- 
Jeff Carter
"C++: The power, elegance and simplicity of a hand grenade."
Ole-Hjalmar Kristensen
90



  parent reply	other threads:[~2005-07-25  5:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-24 18:15 ++ of C in ada nicolas.b
2005-07-24 18:22 ` Ludovic Brenta
2005-07-25  5:55 ` Jeffrey Carter [this message]
2005-07-25 13:18 ` Marc A. Criley
2005-07-25 17:00 ` Martin Krischik
2005-07-25 20:15 ` Robert A Duff
2005-08-02  5:32 ` Craig Carey
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox