www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/07/21:45:13

Message-ID: <lvR6$iAbUXm7EwSj@cweeks.demon.co.uk>
From: Cameron Weeks <cameronweeks AT nospam DOT yahoo DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: In getopt.c wht is place declared as const
Lines: 21
Organization: Personal Use
MIME-Version: 1.0
X-Newsreader: Turnpike Integrated Version 5.01 U <mOHetPbv2YvpfT73yOpdS5sSZu>
Date: Sat, 08 Sep 2001 01:33:02 GMT
NNTP-Posting-Host: 62.31.159.34
X-Complaints-To: http://www.blueyonder.co.uk/abuse
X-Trace: news1.cableinet.net 999912782 62.31.159.34 (Sat, 08 Sep 2001 02:33:02 BST)
NNTP-Posting-Date: Sat, 08 Sep 2001 02:33:02 BST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello,

I am a newbie to C and DJGPP, I think both are wonderful, and DJGPP is currently
proving to be an excellent learning ground for me. I have a question however. In the
file getopt.c as used in many DJGPP programs there is a variable called "place" that
is declared as 

"static const char *place"

Why have the const part of this statement, my particular curiosity was raised
because later on in getopt.c place is unconst-ed, it seems needless, just don't
bother declaring it as const in the first place. It is also declared as static under
the getopt() function so it seems pretty safe from inadvertent alteration.

Any ideas, and thanks in advance.

You can view getopt.c at

http://www.ludd.luth.se/~ams/djgpp/cvs/djgpp/src/libc/posix/unistd/getopt.c
------
Cam...

- Raw text -


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