From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Simple program. Strange results. Date: 29 Aug 2003 10:14:22 GMT Organization: Aachen University of Technology (RWTH) Lines: 29 Message-ID: References: <200308280125 DOT h7S1PFP5020856 AT envy DOT delorie DOT com> <3F4E8FD4 DOT AD6096D8 AT phekda DOT freeserve DOT co DOT uk> <9by3b.3625$cQ1 DOT 943860 AT kent DOT svc DOT tds DOT net> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1062152062 2835 137.226.32.75 (29 Aug 2003 10:14:22 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 29 Aug 2003 10:14:22 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Kenton W. Mellott wrote: > Perhaps you can help me grasp the trouble I'm having understanding > and using some previously suggested code. Some of us could, but I think you really should find a better place for this kind of questions. There's a special newsgroup for beginners learning C or C++ programming in the 'alt' hierarchy: alt.comp.lang.learn.c-c++, which is much better suited to this kind of question. Or just get yourself a good textbook and learn it. > if ((nl = strchr(buf, '\n'))) > -> *nl = 0; > I read this as: if strchr makes nl anything but zero then make it > equal to zero. No. Note how one assignment is made to 'n', the other to '*n'? That discinction is _important_. > Why? What other folloing statement uses it? > Also, why us a pointer to nl used, instead of plain nl. It's not a 'pointer to nl'. 'nl' is a 'pointer to something'. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.