comp.lang.ada
 help / color / mirror / Atom feed
* C++'s pointer vs Ada's Access type
@ 1996-07-31  0:00 Ding-yuan Sheu
  1996-08-01  0:00 ` David Weller
  1996-08-01  0:00 ` johndoe
  0 siblings, 2 replies; 6+ messages in thread
From: Ding-yuan Sheu @ 1996-07-31  0:00 UTC (permalink / raw)
  Cc: mkanko, kshomper, lawlis


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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-08-01  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-31  0:00 C++'s pointer vs Ada's Access type Ding-yuan Sheu
1996-08-01  0:00 ` David Weller
1996-08-01  0:00 ` johndoe
1996-08-01  0:00   ` Mark A Biggar
1996-08-01  0:00   ` Bryce Bardin
1996-08-01  0:00   ` Fraser Wilson

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