From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 7 Sep 93 15:58:55 GMT From: scifi!hawnews.watson.ibm.com!yktnews.watson.ibm.com!ncohen@uunet.uu.net (Norman H. Cohen) Subject: Re: Generic Pointer Type Message-ID: List-Id: In article <2689cj$4m1@pdq.coe.montana.edu>, hoffman@cs.montana.edu (Brad Hoffman) writes: |> Hello, I am a serious Ada rookie and am trying to figure out if it is |> possible to declare a "void-type pointer". Is this possible, and if so, how |> do I do it? The short answer is no: Every access type in Ada is declared to point to objects of one particular type. The longer answer is: Ada has various mechanisms for doing the kinds of things C programmers do with void *. Some of these things are unnecessary in Ada. (For example, unlike a call on malloc, an Ada allocator returns a value of the desired access type.) Others are considered to be of questionable propriety in Ada. (For example, there is a way to convert an access value pointing to type A to an access value pointing to type B so that an object of type A can be manipulated as if it were of type B. This is sometimes necessary, but in most cases there are better ways to get the job done.) Why don't you tell us what problem led you to believe you needed a void-type pointer? Then we can discuss the way that problem is solved in Ada. -- Norman H. Cohen ncohen@watson.ibm.com