delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/04/16:02:24

From: michael DOT mauch AT gmx DOT de (Michael Mauch)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Memory leak.
Date: Sat, 04 Oct 1997 21:08:02 +0200
Organization: Gerhard-Mercator-Universitaet -GH- Duisburg
Lines: 19
Message-ID: <3436785d.8243393@news.uni-duisburg.de>
References: <3 DOT 0 DOT 16 DOT 19971003101449 DOT 36e7aec2 AT hem1 DOT passagen DOT se> <613s4d$hrm AT dfw-ixnews3 DOT ix DOT netcom DOT com> <3435E44A DOT 5C65B10B AT alcyone DOT com>
NNTP-Posting-Host: ppp105.uni-duisburg.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Fri, 03 Oct 1997 23:38:02 -0700, Erik Max Francis <max AT alcyone DOT com>
wrote:

> firewind wrote:
> 
> >         int *foo = (int *)malloc(1024 * (sizeof int));
> 
> Tsk, tsk.  sizeof int is illegal.  You meant sizeof(int).

sizeof is an (unary) operator, not a function, so 

  x = sizeof int;

is just as valid as 

  x = +4;

Regards...
		Michael

- Raw text -


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