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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6b3a3c920575b35a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!atl-c03.usenetserver.com!news.usenetserver.com!news-rtr.nyroc.rr.com!news-out.nyroc.rr.com!twister.nyroc.rr.com.POSTED!53ab2750!not-for-mail From: "REH" Newsgroups: comp.lang.ada References: <1154084819.088112.325730@p79g2000cwp.googlegroups.com> <1154119563.642347.13670@b28g2000cwb.googlegroups.com> <6lByg.12373$1Z5.8869@twister.nyroc.rr.com> Subject: Re: How to pass two dimensional arrays to C X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Message-ID: Date: Sat, 29 Jul 2006 04:28:03 GMT NNTP-Posting-Host: 69.205.134.80 X-Complaints-To: abuse@rr.com X-Trace: twister.nyroc.rr.com 1154147283 69.205.134.80 (Sat, 29 Jul 2006 00:28:03 EDT) NNTP-Posting-Date: Sat, 29 Jul 2006 00:28:03 EDT Organization: Road Runner Xref: g2news2.google.com comp.lang.ada:6007 Date: 2006-07-29T04:28:03+00:00 List-Id: "REH" 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