delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/21/01:59:55

From: leathm AT solwarra DOT gbrmpa DOT gov DOT au (Leath Muller)
Message-Id: <199707210556.PAA25036@solwarra.gbrmpa.gov.au>
Subject: Re: passin a ptr to a 2D array
To: jake AT gapeach DOT com
Date: Mon, 21 Jul 1997 15:56:12 +1000 (EST)
Cc: djgpp AT delorie DOT com
In-Reply-To: <33D1C704.64724AEC@gapeach.com> from "Jacob Martin" at Jul 20, 97 04:06:28 am

I thought I sent this before.... :) But anyway...

> Please fill in the blanks for me:
> 
> void passit(int ___);  /* pass the pointer,Do I use one or two *'s?
> 
> int main()  {
> 
> int mapmake[100][100], __mmp; /*???????????????*/
> mmp=&mapmake[0][0];   /*????????????*/
> passit(int __mmp);
> }
> void passit(int __)  {
> 
> printf("whoopie!");
> }

In main:

int *mmp;
mmp = (int *) (&mapmake[0][0]);
void passit(mmp);

Passit:

void passit(int *ptr)
{
	printf("%d\n", ptr[0]);
}

Leathal.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019