delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/21/00:31:15

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <3C4BA2B3.A96F462C@math.missouri.edu>
From: Stephen Montgomery-Smith <stephen AT math DOT missouri DOT edu>
X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.lang.c,comp.os.msdos.djgpp
Subject: Re: Pointer Blues
References: <ZNN28.965$903 DOT 5465 AT news>
Lines: 24
Date: Mon, 21 Jan 2002 05:10:12 GMT
NNTP-Posting-Host: 24.12.197.197
X-Complaints-To: abuse AT home DOT net
X-Trace: news1.rdc1.ne.home.com 1011589812 24.12.197.197 (Sun, 20 Jan 2002 21:10:12 PST)
NNTP-Posting-Date: Sun, 20 Jan 2002 21:10:12 PST
Organization: Excite AT Home - The Leader in Broadband http://home.com/faster
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> #include <stdio.h>
> int columns = 8;
> int rows = 8;
> int **map;
> int **mask;

.....

  initarray(&map);
  initarray(&mask);
.....

void initarray(int ***arr)
{
  int x;
  *arr = calloc(columns, sizeof(int*));
  for (x=0;x<columns;x++)
    (*arr)[x] = calloc(rows, sizeof(int));
}

-- 
Stephen Montgomery-Smith
stephen AT math DOT missouri DOT edu
http://www.math.missouri.edu/~stephen

- Raw text -


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