delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/17/16:28:54

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Try this one on for size
Date: Thu, 17 Apr 1997 10:21:03 -0400
Organization: Cornell University
Lines: 15
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <335631CF.1F90@cornell.edu>
References: <199704162029 DOT QAA02720 AT hcst DOT net> <33546C31 DOT 6872 AT NO DOT SPAM DOT cs DOT com>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: 128
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

John M. Aldrich wrote:
> 
> Imagine the
> following:
> 
>   struct big_bad_struct *x;
>   x = malloc( sizeof(x) );
> 
> I leave it up to you to determine why this is wrong.  ;)

x = (struct big_bad_struct *) malloc (sizeof(big_bad_struct));

sorry, couldn't resist the temptation.

-- sinan.

- Raw text -


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