🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #101

Re: Problematic Program

#101
From: Victor Bazarov
Date: Sun, 20 Oct 2002 22:06
24 lines
2099 bytes
"CM" <mckenzie992@comcast.net> wrote...
> [...]
> Neil,
> Thanks for the help.  I believe I have corrected all the errors however a
> huge mess at run-time.  again, not sure what direction to take, if you
could
> be so kind as to give your feedback (or anyone else for that matter)
> [..]
> for (i=0;i=noOfStudents-1;i++)

I think you still have a problem here.  If you want the cycle
to execute noOfStudents times, you need to write

    for (i = 0; i < noOfStudents; ++i)

The execution of the 'for' loop happens _if_ the condition is
met, not _until_ it is met.  Besides, in your variation, it is
the _assignment_ operator, not equality.  Equality is designated
by _two_ symbols '=':  i == noOfStudents-1.  Although it is
a bit irrelevant...

Victor
--
Please remove capital A's from my address when replying by mail
Technical Details
Message-ID: <ur6a53lh7r9ie1@corp.supernews.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!telocity-west!TELOCITY!sn-xit-03!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <ESudnc40b4i4hS6gXTWcow@comcast.com> <3db31a56$1_1@mk-nntp-1.news.uk.worldonline.com> <HIacndmZkvBvgy6gXTWcoA@comcast.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d4ba,635d58b7486c58ea
X-Google-Attributes: gid10d4ba,public
X-Google-Thread: 114592,635d58b7486c58ea
X-Google-Attributes: gid114592,public
X-Google-Thread: 109fba,635d58b7486c58ea
X-Google-Attributes: gid109fba,public
X-Google-ArrivalTime: 2002-10-20 15:06:42 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!telocity-west!TELOCITY!sn-xit-03!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: "Victor Bazarov" <vAbazarov@dAnai.com>
Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++
Subject: Re: Problematic Program
Date: Sun, 20 Oct 2002 18:06:07 -0400
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <ur6a53lh7r9ie1@corp.supernews.com>
References: <ESudnc40b4i4hS6gXTWcow@comcast.com> <3db31a56$1_1@mk-nntp-1.news.uk.worldonline.com> <HIacndmZkvBvgy6gXTWcoA@comcast.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Complaints-To: abuse@supernews.com
Lines: 26