comp.lang.ada
 help / color / mirror / Atom feed
From: "REH" <me@you.com>
Subject: Re: How to pass two dimensional arrays to C
Date: Sat, 29 Jul 2006 04:28:03 GMT
Date: 2006-07-29T04:28:03+00:00	[thread overview]
Message-ID: <ntByg.12374$1Z5.5217@twister.nyroc.rr.com> (raw)
In-Reply-To: 6lByg.12373$1Z5.8869@twister.nyroc.rr.com


"REH" <me@you.com> wrote in message 
news:6lByg.12373$1Z5.8869@twister.nyroc.rr.com...
> int v = P + sx * 1 + sy * 2;

I told you I'd make a mistake!  Since C will already adjust for the element 
size, the above is wrong.  We either have to cast to a char*, and do the 
math, and to a int*, or more simply:

int v = P + y * 1 + 2;


REH






  reply	other threads:[~2006-07-29  4:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-28 11:06 How to pass two dimensional arrays to C Jerry
2006-07-28 12:27 ` Jeffrey Creem
2006-07-28 12:27 ` Dmitry A. Kazakov
2006-07-28 16:53 ` Adam Beneschan
2006-07-28 20:15 ` Jeffrey R. Carter
2006-07-28 20:46 ` Jerry
2006-07-28 21:14   ` Jeffrey Creem
2006-07-28 22:54   ` Björn Persson
2006-07-29  1:14     ` Jeffrey R. Carter
2006-07-29  7:11       ` Simon Wright
2006-07-29 22:12         ` Jeffrey R. Carter
2006-07-30 11:18           ` Simon Wright
2006-07-30 11:20           ` Simon Wright
2006-07-29  4:19   ` REH
2006-07-29  4:28     ` REH [this message]
2006-07-29  4:30       ` REH
2006-08-14  6:59     ` Dave Thompson
2006-07-29  5:47 ` REH
2006-08-02  8:20 ` Jerry
2006-08-02  9:03   ` Dmitry A. Kazakov
2006-08-02 10:22     ` Jerry
2006-08-02 18:25   ` Björn Persson
2006-08-05  1:03 ` Jerry
replies disabled

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