🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2392

Re: Coding problem

#2392
From: Tanmoy Bhattacharya
Date: Wed, 27 Mar 1996 00:59
23 lines
1654 bytes
In article <4iepuv$aiv@solutions.solon.com>
<snip>
b: 	It seems, that it is not clear to the compiler, what you mean by
b: *argv[ii]. Note that argv is an array of pointers to char. When i am
b: in such a situation, i always use argv[ii][0], then, according to my
b: understanding, it can only mean one thing: the first character of the
b: text, pointed to by the address found in the ii-th element of array argv.

I hope every C compiler has better understanding than that! *argv[ii]
is exactly the same as argv[ii][0] in all contexts where either is
valid. It is true that technically the latter involves adding a zero
to the pointer before dereferencing, but whenever dereferencing is
allowed, so is adding a zero.

Cheers
Tanmoy
--
tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
<http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
Technical Details
Message-ID: <4ja3sm$pbo@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4iepuv$aiv@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: tanmoy@qcd.Lanl.GOV (Tanmoy Bhattacharya)
Newsgroups: comp.lang.c.moderated
Subject: Re: Coding problem
Date: 26 Mar 1996 18:59:02 -0600
Organization: Los Alamos National Laboratory
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4ja3sm$pbo@solutions.solon.com>
References: <4iepuv$aiv@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com