Mail Archives: djgpp/2002/01/21/10:46:46
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f
|
From: | pete <pfiland AT mindspring DOT com>
|
Newsgroups: | comp.lang.c,comp.os.msdos.djgpp
|
Subject: | Re: Pointer Blues
|
Date: | Mon, 21 Jan 2002 10:35:20 -0500
|
Organization: | PF
|
Lines: | 20
|
Message-ID: | <3C4C3538.340@mindspring.com>
|
References: | <ZNN28.965$903 DOT 5465 AT news>
|
NNTP-Posting-Host: | 3f.35.7c.59
|
Mime-Version: | 1.0
|
X-Server-Date: | 21 Jan 2002 15:36:41 GMT
|
X-Mailer: | Mozilla 3.04Gold (Win95; I)
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Jake wrote:
> thanks
> Jake
> #include <stdio.h>
> int columns = 8;
> arr[x] = (int *)calloc(rows, sizeof(int));
The (int *) cast, on calloc, suppresses the warning that
your compiler should give you because you neglected to
#include <stdlib.h>
for calloc.
Sometimes a program with a memory allocation function,
will work OK, even if you don't #include <stdlib.h>
But if it doesn't, and you didn't, then you're on your own.
--
pete
- Raw text -