home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!portal!sieler
- From: sieler@shell.portal.com (Stan Sieler)
- Subject: Re: linked pascal proc with C program
- Message-ID: <By3ptp.B1r@unix.portal.com>
- Sender: news@unix.portal.com
- Nntp-Posting-Host: jobe
- Organization: Portal Communications Company
- X-Newsreader: Tin 1.1 PL3
- References: <6814@m1.cs.man.ac.uk>
- Date: Sun, 22 Nov 1992 04:58:36 GMT
- Lines: 23
-
- mbheprg@hpa.ee.man.ac.uk (Raju Gurung) writes:
- : Hi,
- : Hope someone can help with this little problem. I'm calling
- : typedef double glmma[SPT];
- : glmma a,b;
- : pas(a,b,c);
- : ------- testpas.p -----
- : type glmma = array [1..spt] of longreal ;
- : PROCEDURE pas(VAR m:glmma; VAR n: glmma; p: integer);
- :
- : When I checked with the debugger I found that m[0]=a[1],m[1]=a[1],m[2]=a[2]....
- : Shouldn't it be m[1]=a[0], m[2]=a[1] ... ?
- : Trying to access m[0] in pas() would give me an error.
-
- Your assertion that the debugger shows that m[0]=a[1] troubles me, as
- m[0] doesn't exist (the first valid element of m is m[1]), and a[1] is
- the second element of a (a[0] is the first). Are you sure you converted
- 0-based to 1-based correctly when using the debugger? I apologize if this
- is an obvious question, but your example made me wonder.
-
- Stan Sieler
- sieler@allegro.com
-
-