delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/09/07:16:27

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Wed, 9 Jan 2002 14:15:16 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Drac0 <m-marti AT online DOT no>
cc: djgpp AT delorie DOT com
Subject: Re: command line argument
In-Reply-To: <s2W_7.24353$KQ3.447543@news1.oke.nextra.no>
Message-ID: <Pine.SUN.3.91.1020109141336.2305C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 9 Jan 2002, Drac0 wrote:

> main(int argc, int * argv[])

This should say

  int main (int argc, char *argv[])

> if(* argv[1] >= 100)

You shouldn't use *argv[1] if argc isn't at least 2.  Otherwise, argv[2] 
is a NULL pointer, and dereferencing a NULL pointer is a no-no.

- Raw text -


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