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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed3864cb23152ae6,start X-Google-Attributes: gid103376,public From: Ding-yuan Sheu Subject: C++'s pointer vs Ada's Access type Date: 1996/07/31 Message-ID: <31FFD4A6.41C6@afit.af.mil>#1/1 X-Deja-AN: 171279317 cc: mkanko@afit.af.mil, kshomper@afit.af.mil, lawlis@afit.af.mil, content-type: text/plain; charset=us-ascii organization: Air Force Institute of Technology mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; IRIX 5.3 IP20) Date: 1996-07-31T00:00:00+00:00 List-Id: Hello all Ada guru, I am doing some C++ programs conversion into Ada95 and I have a problem in converting C++ pointer into Ada95's access type. I am not an Ada expert. I hope someone can give me a hand. I think C++'s pointer type is basically similar to Ada's access type. Therefore, for the following C++ declaraction: int* ip; I convert it into Ada: type Integer_Ptr is access all Integer; ip : Integer_Ptr; However, there comes a problem. In C++, ip can be a pointer that points to a integer array. Therefore, C++ programmers can do the following initialization: int Array[100]; ip = &Array; for (i:=0;i++,99) { (*ip+i) = 0; } My question is how I can do the same thing in Ada by using ip to initialize Array instead to directly initialize Array. I know my question might be stupid for you Ada experts. Your comments are preciou to me. Any Help will be appreciated. Thanks. Steven