Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #129666 > unrolled thread
| Started by | Dan Purgert <dan@djph.net> |
|---|---|
| First post | 2018-04-24 13:39 +0000 |
| Last post | 2018-04-27 00:23 -0700 |
| Articles | 20 on this page of 131 — 31 participants |
Back to article view | Back to comp.lang.c
Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-24 13:39 +0000
Re: Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-24 16:38 +0100
Re: Need some help getting to my feet Real Troll <real.troll@trolls.com> - 2018-04-24 13:40 -0400
Re: Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-24 08:38 -0700
[Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-24 18:06 +0000
Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-25 07:33 -0700
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-25 07:49 -0700
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-25 21:28 +0000
Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-04-28 14:26 +0000
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-28 20:25 +0000
Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-04-29 15:12 +0000
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-29 16:49 +0100
Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-04-30 15:30 +0000
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-30 17:06 +0100
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-30 09:12 -0700
Re: [Solved] Need some help getting to my feet C W Rose <cwr@seckford.org> - 2018-05-02 15:19 +0100
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-05-02 07:54 -0700
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-05-03 12:45 +0000
Re: [Solved] Need some help getting to my feet antispam@math.uni.wroc.pl - 2018-05-05 14:22 +0000
Re: [Solved] Need some help getting to my feet Steve Carroll <frelwizzen@gmail.com> - 2018-05-05 08:42 -0700
Re: [Solved] Need some help getting to my feet C W Rose <cwr@seckford.org> - 2018-05-07 16:34 +0100
Re: [Solved] Need some help getting to my feet Steve Carroll <frelwizzen@gmail.com> - 2018-05-07 09:37 -0700
Re: [Solved] Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-05-04 10:19 +0200
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-05-04 11:31 +0100
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-29 08:53 -0700
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-29 18:14 -0700
Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-25 08:54 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-25 09:24 -0700
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-25 18:10 +0100
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-25 10:48 -0700
Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-04-25 19:23 +0000
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Bruce S <bruces42@hotmail.com> - 2018-04-25 16:55 -0600
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-04-25 16:03 -0700
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Bruce S <bruces42@hotmail.com> - 2018-04-25 18:02 -0600
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-04-25 17:14 -0700
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Bruce S <bruces42@hotmail.com> - 2018-04-26 13:31 -0600
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-04-26 03:27 +0000
Re: Casting the return value of malloc() (Was: [Solved] Need some help getting to my feet) Dan Purgert <dan@djph.net> - 2018-04-26 11:06 +0000
Re: [Solved] Need some help getting to my feet 1alvinalbrecht1@gmail.com - 2018-04-25 18:41 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 07:26 -0700
Re: [Solved] Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-25 16:26 +0000
Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-25 21:50 +0100
Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-26 01:47 -0700
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-26 02:18 -0700
Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-26 11:18 +0100
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-26 11:33 +0100
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-26 05:26 -0700
Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-27 00:09 +0100
Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-26 09:14 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 10:26 -0700
Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-27 00:02 +0100
Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-27 02:35 -0700
Re: [Solved] Need some help getting to my feet Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-04-27 11:34 +0100
Re: [Solved] Need some help getting to my feet mark.bluemel@gmail.com - 2018-04-27 04:14 -0700
STDIO.H vs stdio.h (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-04-27 13:08 +0000
Re: STDIO.H vs stdio.h (Was: [Solved] Need some help getting to my feet) Manfred <noname@invalid.add> - 2018-04-27 18:52 +0200
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-27 07:08 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 10:36 -0700
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-27 19:04 +0100
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 11:26 -0700
Re: [Solved] Need some help getting to my feet scott@slp53.sl.home (Scott Lurndal) - 2018-04-27 18:45 +0000
Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-04-30 03:43 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-30 09:10 -0700
Re: [Solved] Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-30 23:32 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 07:33 -0700
Re: [Solved] Need some help getting to my feet jameskuyper@verizon.net - 2018-04-26 08:38 -0700
Re: [Solved] Need some help getting to my feet already5chosen@yahoo.com - 2018-04-27 03:30 -0700
Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-27 08:41 -0700
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-27 17:04 +0000
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 11:06 -0700
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-27 20:15 +0000
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 13:47 -0700
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-27 22:06 +0100
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 14:51 -0700
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-28 00:25 +0100
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 17:23 -0700
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-28 01:39 +0100
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-27 19:22 -0700
Re: [Solved] Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-05-04 10:36 +0200
Re: [Solved] Need some help getting to my feet bartc <bc@freeuk.com> - 2018-05-04 11:21 +0100
Re: [Solved] Need some help getting to my feet Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-05-04 04:03 -0700
Re: [Solved] Need some help getting to my feet David Brown <david.brown@hesbynett.no> - 2018-05-04 14:03 +0200
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-05-04 09:19 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-05-04 11:00 -0700
Re: [Solved] Need some help getting to my feet David Brown <david.brown@hesbynett.no> - 2018-05-05 18:39 +0200
Re: [Solved] Need some help getting to my feet Steve Carroll <frelwizzen@gmail.com> - 2018-05-07 16:23 -0700
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-28 12:11 +0000
Re: [Solved] Need some help getting to my feet luser droog <luser.droog@gmail.com> - 2018-04-27 14:12 -0700
Re: [Solved] Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-28 12:21 +0000
Re: [Solved] Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-05-04 13:31 +0000
Re: [Solved] Need some help getting to my feet luser droog <luser.droog@gmail.com> - 2018-05-04 17:19 -0700
Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-05-18 21:55 -0700
Re: [Solved] Need some help getting to my feet already5chosen@yahoo.com - 2018-05-21 03:26 -0700
Re: [Solved] Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-06-14 03:00 -0700
Mixing declarations and statements in C code (Was: [Solved] Need some help getting to my feet) gazelle@shell.xmission.com (Kenny McCormack) - 2018-12-26 06:43 +0000
Re: [Solved] Need some help getting to my feet Anton Shepelev <anton.txt@g{oogle}mail.com> - 2018-12-26 19:02 +0300
Re: [Solved] Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-12-31 18:01 +0000
Re: [Solved] Need some help getting to my feet Richard Damon <Richard@Damon-Family.org> - 2018-12-31 17:16 -0500
Re: [Solved] Need some help getting to my feet Bart <bc@freeuk.com> - 2018-12-31 22:44 +0000
Re: [Solved] Need some help getting to my feet Ike Naar <ike@iceland.freeshell.org> - 2019-01-01 19:14 +0000
Re: [Solved] Need some help getting to my feet rbowman <bowman@montana.com> - 2019-01-01 13:14 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2019-01-01 12:49 -0800
Re: [Solved] Need some help getting to my feet rbowman <bowman@montana.com> - 2019-01-01 15:55 -0700
Re: [Solved] Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2019-01-01 16:05 -0800
Re: [Solved] Need some help getting to my feet rbowman <bowman@montana.com> - 2019-01-01 22:17 -0700
Re: [Solved] Need some help getting to my feet Bart <bc@freeuk.com> - 2019-01-01 20:25 +0000
Re: [Solved] Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-05-04 11:48 +0000
Re: Need some help getting to my feet Ed Kellett <e@kellett.im> - 2018-04-24 16:40 +0100
Re: Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-24 11:01 -0700
Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-24 15:50 +0000
Re: Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-24 17:21 +0000
Re: Need some help getting to my feet Real Troll <real.troll@trolls.com> - 2018-04-24 13:20 -0400
Re: Need some help getting to my feet Real Troll <real.troll@trolls.com> - 2018-04-24 13:30 -0400
Re: Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-24 17:42 +0000
Re: Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-24 18:26 +0000
Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-25 19:19 +0000
Re: Need some help getting to my feet Dan Purgert <dan@djph.net> - 2018-04-25 21:30 +0000
Re: Need some help getting to my feet bartc <bc@freeuk.com> - 2018-04-25 22:55 +0100
Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-27 08:49 +0000
Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-25 15:37 +0000
Re: Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-25 09:27 -0700
Re: Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-04-26 13:22 +0200
Re: Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-26 09:21 -0700
Re: Need some help getting to my feet Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-04-27 08:16 +0000
Re: Need some help getting to my feet Tim Rentsch <txr@alumni.caltech.edu> - 2018-04-27 09:36 -0700
Re: Need some help getting to my feet Wouter Verhelst <w@uter.be> - 2018-05-04 10:41 +0200
Re: Need some help getting to my feet Spiros Bousbouras <spibou@gmail.com> - 2018-04-28 14:27 +0000
Re: Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-24 11:09 -0700
Re: Need some help getting to my feet C W Rose <cwr@seckford.org> - 2018-04-25 18:59 +0100
Re: Need some help getting to my feet Keith Thompson <kst-u@mib.org> - 2018-04-26 10:42 -0700
Re: Need some help getting to my feet Steven Petruzzellis <frelwizzen@gmail.com> - 2018-04-27 00:23 -0700
Page 3 of 7 — ← Prev page 1 2 [3] 4 5 6 7 Next page →
| From | Spiros Bousbouras <spibou@gmail.com> |
|---|---|
| Date | 2018-04-25 16:26 +0000 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <vss2mRa5zlV2ZGm8ZlNjs89DfacWi@bongo-ra.co> |
| In reply to | #129721 |
On Wed, 25 Apr 2018 08:54:47 -0700 (PDT) Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote: > On Tuesday, April 24, 2018 at 7:06:50 PM UTC+1, Dan Purgert wrote: > > > > Thanks Tim, Ed, Jorgen, and Ben. Given "get K&R" is the prevailing > > concensus, I'll start there (maybe I'll get lucky and it's still in that > > stash of programming books I kept). I think all the questions back to me > > reflect Tim's above, and he had the most - so just sending this one > > follow-up. > > > You have to be careful with the consensus. > > For example the consensus in this ng will be that Schild's tutorials > should be avoided. That's because they contain technical errors. But > that doesn't actually matter too much for a tutorial, people who don't > have much experience teaching often think that teaching an error is > a disaster, in fact it's often better to teach a simplification. For > example void main() is an error in C (C programs must return a > success / failure flag to the environment, so it should be int main()) > but the vast majority of compilers accept it, and in fact the flag isn't > really of any use for beginner-level programs. void main() offers no advantages and is no simplification over int main() regardless of legality and whether compilers can handle it. If by "flag" you mean the return value then I disagree that it's no use to beginners. One of the things I did as a beginner and still do is to write little command line utilities in C which I can't write comfortably in a Unix shell (or similar) ; sometimes I can write them but I'm just in the mood to write them in C. In order for such utilities to work correctly in shell scripts , like as parts of && or || pipes , they must return an appropriate value depending on success or failure. -- The swirling mist lay in the bottom of such great bowls like a broth of dreams. "Consider Phlebas"
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2018-04-25 21:50 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <87o9i7ovsc.fsf@bsb.me.uk> |
| In reply to | #129721 |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > On Tuesday, April 24, 2018 at 7:06:50 PM UTC+1, Dan Purgert wrote: >> >> Thanks Tim, Ed, Jorgen, and Ben. Given "get K&R" is the prevailing >> concensus, I'll start there (maybe I'll get lucky and it's still in that >> stash of programming books I kept). I think all the questions back to me >> reflect Tim's above, and he had the most - so just sending this one >> follow-up. >> > You have to be careful with the consensus. > > For example the consensus in this ng will be that Schild's tutorials You probably mean Schildt. > should be avoided. That's because they contain technical errors. But > that doesn't actually matter too much for a tutorial, people who don't > have much experience teaching often think that teaching an error is > a disaster, in fact it's often better to teach a simplification. I don't know the tutorials by Schildt, but "C: The Complete Reference" has numerous examples of bad practice that are hard to explain as simplifications in a reference work. And it also includes numerous factual errors that are in no way simplifications. Are the tutorials any better? > For > example void main() is an error in C (C programs must return a > success / failure flag to the environment, so it should be int main()) > but the vast majority of compilers accept it, and in fact the flag isn't > really of any use for beginner-level programs. Why do you say that? Small utilities that return useful status information make ideal beginner-level exercises. <snip> -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.arthur.mclean@gmail.com> |
|---|---|
| Date | 2018-04-26 01:47 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <752bbd42-4649-4537-bb9a-01ecc72d3b0c@googlegroups.com> |
| In reply to | #129749 |
On Wednesday, April 25, 2018 at 9:50:37 PM UTC+1, Ben Bacarisse wrote: > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > > On Tuesday, April 24, 2018 at 7:06:50 PM UTC+1, Dan Purgert wrote: > >> > >> Thanks Tim, Ed, Jorgen, and Ben. Given "get K&R" is the prevailing > >> concensus, I'll start there (maybe I'll get lucky and it's still in that > >> stash of programming books I kept). I think all the questions back to me > >> reflect Tim's above, and he had the most - so just sending this one > >> follow-up. > >> > > You have to be careful with the consensus. > > > > For example the consensus in this ng will be that Schild's tutorials > > You probably mean Schildt. > > > should be avoided. That's because they contain technical errors. But > > that doesn't actually matter too much for a tutorial, people who don't > > have much experience teaching often think that teaching an error is > > a disaster, in fact it's often better to teach a simplification. > > I don't know the tutorials by Schildt, but "C: The Complete Reference" > has numerous examples of bad practice that are hard to explain as > simplifications in a reference work. And it also includes numerous > factual errors that are in no way simplifications. Are the tutorials > any better? > He's also the author of "Teach yourself C" Here's an example The most commonly required header file is called STDIO.H. Here is the directive that includes this file #include <stdio.h> You can specify the filename in either upper- or lowercase but lowercase is the traditional method. The STDIO.H header file contains, among other things, the information related to the printf() library function. Notice that the #include directive does not end with a semicolon. The reason for this is that #include is not a C keyword that can define a statement. Instead it is an instruction to the C compiler itself.
[toc] | [prev] | [next] | [standalone]
| From | Steven Petruzzellis <frelwizzen@gmail.com> |
|---|---|
| Date | 2018-04-26 02:18 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <b40c348a-f634-4fd4-bb05-d843542b8345@googlegroups.com> |
| In reply to | #129771 |
On Thursday, April 26, 2018 at 1:48:11 AM UTC-7, Malcolm McLean wrote: > On Wednesday, April 25, 2018 at 9:50:37 PM UTC+1, Ben Bacarisse wrote: > > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > > > > On Tuesday, April 24, 2018 at 7:06:50 PM UTC+1, Dan Purgert wrote: > > >> > > >> Thanks Tim, Ed, Jorgen, and Ben. Given "get K&R" is the prevailing > > >> concensus, I'll start there (maybe I'll get lucky and it's still in that > > >> stash of programming books I kept). I think all the questions back to me > > >> reflect Tim's above, and he had the most - so just sending this one > > >> follow-up. > > >> > > > You have to be careful with the consensus. > > > > > > For example the consensus in this ng will be that Schild's tutorials > > > > You probably mean Schildt. > > > > > should be avoided. That's because they contain technical errors. But > > > that doesn't actually matter too much for a tutorial, people who don't > > > have much experience teaching often think that teaching an error is > > > a disaster, in fact it's often better to teach a simplification. > > > > I don't know the tutorials by Schildt, but "C: The Complete Reference" > > has numerous examples of bad practice that are hard to explain as > > simplifications in a reference work. And it also includes numerous > > factual errors that are in no way simplifications. Are the tutorials > > any better? > > > He's also the author of "Teach yourself C" > > Here's an example > > The most commonly required header file is called STDIO.H. Here is the > directive that includes this file > > #include <stdio.h> > > You can specify the filename in either upper- or lowercase but lowercase > is the traditional method. The STDIO.H header file contains, among > other things, the information related to the printf() library function. > Notice that the #include directive does not end with a semicolon. > The reason for this is that #include is not a C keyword that can > define a statement. Instead it is an instruction to the C compiler itself. Open source is only inexpensive if your time has no value. Studying Linux... still a novice... Can UTF-8 characters be concatenated into a string with a logical connection to the "real" world; that is the question posed recently by those astonished at the fire-hose of nonsense from assorted google-posters and basement-dwelling ultra-cranks. It was Allah who flooded Vennie Bowden's site millions of times and refused to admit it. What Allah really means: His remarkable "problem solving competence" blinded him to an add-on he wants that can be quickly Googled for this application. The only thing malfunctioning here is Allah. -- Eight things to never feed your dog http://www.5z8.info/dont-just-drizzle_y8q4ut_5waystokillwithamelon https://goo.gl/Fho5Nq http://www.5z8.info/php-start_GPS_tracking-user_f8h9lv_-OPEN-WEBCAM---START-RECORD-- Jonas Eklundh Communication
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2018-04-26 11:18 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <87in8etgms.fsf@bsb.me.uk> |
| In reply to | #129771 |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > On Wednesday, April 25, 2018 at 9:50:37 PM UTC+1, Ben Bacarisse wrote: >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: >> >> > On Tuesday, April 24, 2018 at 7:06:50 PM UTC+1, Dan Purgert wrote: >> >> >> >> Thanks Tim, Ed, Jorgen, and Ben. Given "get K&R" is the prevailing >> >> concensus, I'll start there (maybe I'll get lucky and it's still in that >> >> stash of programming books I kept). I think all the questions back to me >> >> reflect Tim's above, and he had the most - so just sending this one >> >> follow-up. >> >> >> > You have to be careful with the consensus. >> > >> > For example the consensus in this ng will be that Schild's tutorials >> >> You probably mean Schildt. >> >> > should be avoided. That's because they contain technical errors. But >> > that doesn't actually matter too much for a tutorial, people who don't >> > have much experience teaching often think that teaching an error is >> > a disaster, in fact it's often better to teach a simplification. >> >> I don't know the tutorials by Schildt, but "C: The Complete Reference" >> has numerous examples of bad practice that are hard to explain as >> simplifications in a reference work. And it also includes numerous >> factual errors that are in no way simplifications. Are the tutorials >> any better? >> > He's also the author of "Teach yourself C" > > Here's an example > > The most commonly required header file is called STDIO.H. Here is the > directive that includes this file > > #include <stdio.h> > > You can specify the filename in either upper- or lowercase but lowercase > is the traditional method. The STDIO.H header file contains, among > other things, the information related to the printf() library function. > Notice that the #include directive does not end with a semicolon. > The reason for this is that #include is not a C keyword that can > define a statement. Instead it is an instruction to the C compiler itself. What do you believe this shows? Do you think the errors here make things simpler? -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2018-04-26 11:33 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <sVhEC.17461$tw.917@fx42.am4> |
| In reply to | #129776 |
On 26/04/2018 11:18, Ben Bacarisse wrote: > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: >> Here's an example >> >> The most commonly required header file is called STDIO.H. Here is the >> directive that includes this file >> >> #include <stdio.h> >> >> You can specify the filename in either upper- or lowercase but lowercase >> is the traditional method. The STDIO.H header file contains, among >> other things, the information related to the printf() library function. >> Notice that the #include directive does not end with a semicolon. >> The reason for this is that #include is not a C keyword that can >> define a statement. Instead it is an instruction to the C compiler itself. > > What do you believe this shows? Do you think the errors here make > things simpler? It seems clear enough to me. What is the problem? Trying to include STDIO.H probably won't work in Linux, but it WILL work in Windows. So is not something that is wrong as far as the language is concerned. -- bartc
[toc] | [prev] | [next] | [standalone]
| From | Steven Petruzzellis <frelwizzen@gmail.com> |
|---|---|
| Date | 2018-04-26 05:26 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <9ca563da-3896-475d-aa7f-bb8ff29c2855@googlegroups.com> |
| In reply to | #129778 |
On Thursday, April 26, 2018 at 3:33:05 AM UTC-7, Bart wrote: > On 26/04/2018 11:18, Ben Bacarisse wrote: > > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > >> Here's an example > >> > >> The most commonly required header file is called STDIO.H. Here is the > >> directive that includes this file > >> > >> #include <stdio.h> > >> > >> You can specify the filename in either upper- or lowercase but lowercase > >> is the traditional method. The STDIO.H header file contains, among > >> other things, the information related to the printf() library function. > >> Notice that the #include directive does not end with a semicolon. > >> The reason for this is that #include is not a C keyword that can > >> define a statement. Instead it is an instruction to the C compiler itself. > > > > What do you believe this shows? Do you think the errors here make > > things simpler? > > It seems clear enough to me. What is the problem? > > Trying to include STDIO.H probably won't work in Linux, but it WILL work > in Windows. So is not something that is wrong as far as the language is > concerned. > > -- > bartc Recently I did work on and showed some AppleScript for the front end (only works on my computer) which is the only thing you can do when trying to avoid nospam's kiddie crap while reading with Google Groups. I think the point is far from just to get them to listen to him. The point is likely to piss Krystal Lynn off for spraying outside groups he knows I frequent. You purchased it and did extensive testing and your "amazing brain powers" lead you to that opinion, did they? Given how repeatedly it is clear that nospam's signature is some misquote of a quote Krystal Lynn made which had been a drubbing on nospam for something he did which was asinine/untrue/etc... its clearly a repeated demonstration of nospam's unending butthurt for having been so routinely humiliated: nospam is self-evidently not able of dealing with this group. Calls it "obsessing" over him, even though he continues to cause that exact rejoiner. All that matters is that nospam gets to deliver his automated call and then hang up and giggle about it. The fact that Krystal Lynn is an involuntary target on the other end of the phone is what's funny. What did Krystal Lynn expect from the lying imbecile? That nospam halfwit has nothing to lose but time. He has nothing else. Especially not a caring family. -- This broke the Internet http://www.5z8.info/hateminorities_t7l3gt_linked-in-of-sex Jonas Eklundh Communication
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2018-04-27 00:09 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <87vacdsgz5.fsf@bsb.me.uk> |
| In reply to | #129778 |
bartc <bc@freeuk.com> writes: > On 26/04/2018 11:18, Ben Bacarisse wrote: >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > >>> Here's an example >>> >>> The most commonly required header file is called STDIO.H. Here is the >>> directive that includes this file >>> >>> #include <stdio.h> >>> >>> You can specify the filename in either upper- or lowercase but lowercase >>> is the traditional method. The STDIO.H header file contains, among >>> other things, the information related to the printf() library function. >>> Notice that the #include directive does not end with a semicolon. >>> The reason for this is that #include is not a C keyword that can >>> define a statement. Instead it is an instruction to the C compiler itself. >> >> What do you believe this shows? Do you think the errors here make >> things simpler? > > It seems clear enough to me. What is the problem? I asked if the errors make it simpler. Malcolm seemed to be suggesting that the errors in Schildt's books are there to make things simpler -- that they are glossing over unnecessary detail. I could not fit this example with that explanation so I wondered what it was supposed to be showing me. > Trying to include STDIO.H probably won't work in Linux, but it WILL > work in Windows. So is not something that is wrong as far as the > language is concerned. I don't know what you mean here. "You can specify the filename in either upper- or lowercase" is not a correct statement about the C language. It is correct about some implementations of C but I don't see how saying that simplifies the text. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.arthur.mclean@gmail.com> |
|---|---|
| Date | 2018-04-26 09:14 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <4330b8c3-bcd0-4213-a276-a0c4fb25c810@googlegroups.com> |
| In reply to | #129776 |
On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote: > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > What do you believe this shows? Do you think the errors here make > things simpler? > The tutorial was obviously written when everyone used DOS. Except a few Unix types in academic or high end professional computing who mostly knew C anyway. The books were very popular, and part of the reason is the informal style, avoiding over-qualification or the premature use of technical terms.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-04-26 10:26 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <lno9i5g9pk.fsf@kst-u.example.com> |
| In reply to | #129800 |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>
>> What do you believe this shows? Do you think the errors here make
>> things simpler?
>>
> The tutorial was obviously written when everyone used DOS. Except a
> few Unix types in academic or high end professional computing who
> mostly knew C anyway.
> The books were very popular, and part of the reason is the informal style,
> avoiding over-qualification or the premature use of technical
> terms.
There has never been a time when everyone used DOS. If Schildt had
written a book called "Teach Yourself C for DOS", such oversights might
be excusable. The book was called "Teach Yourself C", and was not
billed as being specific to any particular environment.
You've advocated simplification for the sake of teaching. The simple
way to teach the use of <stdio.h> is to say something like:
Write
#include <stdio.h>
at the top of your source file.
Referring to <STDIO.H> (which as James Kuyper points out compilers
are *may* accept) is both more complicated and incorrect in general.
It's been said that Schildt writes in an engaging manner. That's
part of the problem. It made his books popular and created more
work for the rest of us helping people unlearn the falsehoods he
taught them.
Malcolm, do you seriously think that telling beginning programmers
that they can use either <stdio.h> or <STDIO.H> is *simpler* than
just telling them to use <stdio.h>?
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2018-04-27 00:02 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <87y3h9sha3.fsf@bsb.me.uk> |
| In reply to | #129800 |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote: >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: >> >> What do you believe this shows? Do you think the errors here make >> things simpler? >> > The tutorial was obviously written when everyone used DOS. Except a > few Unix types in academic or high end professional computing who > mostly knew C anyway. The reason for the error is beside the point. I wondered why you thought making it simplified anything. > The books were very popular, and part of the reason is the informal style, > avoiding over-qualification or the premature use of technical > terms. But this example introduces more technical terms whose only purpose appears to make a mistake. Surely it's just better to leave out any talk about letter cases. And I find the part about the semi-colon and keywords defining statements to be excessively technical without being particularly clear. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Malcolm McLean <malcolm.arthur.mclean@gmail.com> |
|---|---|
| Date | 2018-04-27 02:35 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <5da45b9b-6b02-4e92-ac51-1abf1e8fe4c4@googlegroups.com> |
| In reply to | #129832 |
On Friday, April 27, 2018 at 12:02:38 AM UTC+1, Ben Bacarisse wrote: > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > > On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote: > >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > >> > >> What do you believe this shows? Do you think the errors here make > >> things simpler? > >> > > The tutorial was obviously written when everyone used DOS. Except a > > few Unix types in academic or high end professional computing who > > mostly knew C anyway. > > The reason for the error is beside the point. I wondered why you > thought making it simplified anything. > The header file itself was called STDIO.H on DOS systems, which didn't allow lower case filenames at the time. But the compiler accepted stdio.h in lower case. So that's potentially confusing. Schildt is telling his readers that they might see upper case, whilst telling them to prefer lower case. Which is correct enough. > > The books were very popular, and part of the reason is the informal style, > > avoiding over-qualification or the premature use of technical > > terms. > > But this example introduces more technical terms whose only purpose > appears to make a mistake. Surely it's just better to leave out any > talk about letter cases. > > And I find the part about the semi-colon and keywords defining > statements to be excessively technical without being particularly > clear. > He's just explained the anatomy of a C statement. It ends in a semi-colon. It's not always clear to a beginner where semicolons go and where they don't. They don't terminate #include directives. That of course is because these are preprocessing directives rather than actual C statements. But he's withholding some of the full truth there for pedagogical purposes. That's why the writing is clear and engaging.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2018-04-27 11:34 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <87y3h9q6oq.fsf@bsb.me.uk> |
| In reply to | #129847 |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > On Friday, April 27, 2018 at 12:02:38 AM UTC+1, Ben Bacarisse wrote: >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: >> >> > On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote: >> >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: >> >> >> >> What do you believe this shows? Do you think the errors here make >> >> things simpler? >> >> >> > The tutorial was obviously written when everyone used DOS. Except a >> > few Unix types in academic or high end professional computing who >> > mostly knew C anyway. >> >> The reason for the error is beside the point. I wondered why you >> thought making it simplified anything. >> > The header file itself was called STDIO.H on DOS systems, which didn't > allow lower case filenames at the time. I don't think that is true. DOS file names are case-insensitive and were listed in uppercase, but I think you were always able to write them in lowercase (and, if I recall, everyone did). > But the compiler accepted > stdio.h in lower case. Didn't every program do the same? > So that's potentially confusing. Schildt is > telling his readers that they might see upper case, whilst telling > them to prefer lower case. I don't think any DOS user would confused by this. They will have been seeing uppercase names and typing lowercase ones from day one. And I was teaching C (well, that's a small white lie -- a subset of C++) to beginners using both DOS and Unix at about that time and I don't recall anyone being confused by how DOS lists it's files. > Which is correct enough. I don't think the error simplifies anything, but if the author really thinks that there is scope for confusion, a remark about how you system might show the file as STDIO.H would be correct without making the text more complicated than the text with the error in it. <snip> -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | mark.bluemel@gmail.com |
|---|---|
| Date | 2018-04-27 04:14 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <7438f8a7-b8af-4a4e-8a23-12eea64055eb@googlegroups.com> |
| In reply to | #129849 |
On Friday, 27 April 2018 11:34:22 UTC+1, Ben Bacarisse wrote: > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > > On Friday, April 27, 2018 at 12:02:38 AM UTC+1, Ben Bacarisse wrote: > >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > The header file itself was called STDIO.H on DOS systems, which didn't > > allow lower case filenames at the time. > > I don't think that is true. DOS file names are case-insensitive and > were listed in uppercase, but I think you were always able to write them > in lowercase (and, if I recall, everyone did). <https://en.wikipedia.org/wiki/8.3_filename> suggests so.
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2018-04-27 13:08 +0000 |
| Subject | STDIO.H vs stdio.h (Was: [Solved] Need some help getting to my feet) |
| Message-ID | <pbv7c1$vg2$1@news.xmission.com> |
| In reply to | #129849 |
In article <87y3h9q6oq.fsf@bsb.me.uk>, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote: ... >> The header file itself was called STDIO.H on DOS systems, which didn't >> allow lower case filenames at the time. > >I don't think that is true. DOS file names are case-insensitive and >were listed in uppercase, but I think you were always able to write them >in lowercase (and, if I recall, everyone did). It is true. I'm 98% sure that if you opened up your disk editor and looked at the sectors, you'd see the filenames in upper case. That you were able to write them in lower case and have it work is because the filename matching in DOS is, as been noted many times, case-insensitive. Note that this is different from later Windows filesystems, starting with "vfat", which were case-retentive, though still case-insensitive. -- Conservatives want smaller government for the same reason criminals want fewer cops.
[toc] | [prev] | [next] | [standalone]
| From | Manfred <noname@invalid.add> |
|---|---|
| Date | 2018-04-27 18:52 +0200 |
| Subject | Re: STDIO.H vs stdio.h (Was: [Solved] Need some help getting to my feet) |
| Message-ID | <pbvkg8$3uk$1@gioia.aioe.org> |
| In reply to | #129853 |
On 4/27/2018 3:08 PM, Kenny McCormack wrote: > In article <87y3h9q6oq.fsf@bsb.me.uk>, > Ben Bacarisse <ben.usenet@bsb.me.uk> wrote: > ... >>> The header file itself was called STDIO.H on DOS systems, which didn't >>> allow lower case filenames at the time. >> >> I don't think that is true. DOS file names are case-insensitive and >> were listed in uppercase, but I think you were always able to write them >> in lowercase (and, if I recall, everyone did). > > It is true. > > I'm 98% sure that if you opened up your disk editor and looked at the > sectors, you'd see the filenames in upper case. > > That you were able to write them in lower case and have it work is because > the filename matching in DOS is, as been noted many times, case-insensitive. I'm 98% sure as well, but still, this does not mean that lowercase filenames were "not allowed" In fact you could (and should) very well write <stdio.h>, and on DOS the OS would load the STDIO.H file from disk. On a case-sensitive system, it would correctly load the stdio.h file from disk. Back to the point of the original Schildt example, this has nothing to do with any "traditional method", as instead he was 'explaining'. Writing <stdio.h> was the correct way to write a portable C program. > > Note that this is different from later Windows filesystems, starting with > "vfat", which were case-retentive, though still case-insensitive. >
[toc] | [prev] | [next] | [standalone]
| From | Steven Petruzzellis <frelwizzen@gmail.com> |
|---|---|
| Date | 2018-04-27 07:08 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <4228758b-4598-4d58-83da-db9e2ea51953@googlegroups.com> |
| In reply to | #129847 |
On Friday, April 27, 2018 at 2:35:42 AM UTC-7, Malcolm McLean wrote: > On Friday, April 27, 2018 at 12:02:38 AM UTC+1, Ben Bacarisse wrote: > > Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > > > > On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote: > > >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes: > > >> > > >> What do you believe this shows? Do you think the errors here make > > >> things simpler? > > >> > > > The tutorial was obviously written when everyone used DOS. Except a > > > few Unix types in academic or high end professional computing who > > > mostly knew C anyway. > > > > The reason for the error is beside the point. I wondered why you > > thought making it simplified anything. > > > The header file itself was called STDIO.H on DOS systems, which didn't > allow lower case filenames at the time. But the compiler accepted > stdio.h in lower case. So that's potentially confusing. Schildt is > telling his readers that they might see upper case, whilst telling > them to prefer lower case. Which is correct enough. > > > > The books were very popular, and part of the reason is the informal style, > > > avoiding over-qualification or the premature use of technical > > > terms. > > > > But this example introduces more technical terms whose only purpose > > appears to make a mistake. Surely it's just better to leave out any > > talk about letter cases. > > > > And I find the part about the semi-colon and keywords defining > > statements to be excessively technical without being particularly > > clear. > > > He's just explained the anatomy of a C statement. It ends in a semi-colon. > It's not always clear to a beginner where semicolons go and where > they don't. They don't terminate #include directives. That of course > is because these are preprocessing directives rather than actual > C statements. But he's withholding some of the full truth there for > pedagogical purposes. That's why the writing is clear and engaging. But Vennie Bowden, Realtor feels the need to insult the herd. So be it. Vennie Bowden, Realtor's actions are really thoroughly unfair. There can be no dispute that as soon as any bygone 'blocked person' does anything to hurt the loser's feelings that they will be blocked again.Nobody is being controlled by Microsoft. I believe we have two different beliefs entirely. -- "You'll notice how quickly he loses interest when everything is about him. He clearly wants the attention" Steve Carroll, making the dumbest comment ever uttered.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-04-27 10:36 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <ln7eosft5v.fsf@kst-u.example.com> |
| In reply to | #129847 |
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On Friday, April 27, 2018 at 12:02:38 AM UTC+1, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>>
>> > On Thursday, April 26, 2018 at 11:19:03 AM UTC+1, Ben Bacarisse wrote:
>> >> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>> >>
>> >> What do you believe this shows? Do you think the errors here make
>> >> things simpler?
>> >>
>> > The tutorial was obviously written when everyone used DOS. Except a
>> > few Unix types in academic or high end professional computing who
>> > mostly knew C anyway.
>>
>> The reason for the error is beside the point. I wondered why you
>> thought making it simplified anything.
>>
> The header file itself was called STDIO.H on DOS systems, which didn't
> allow lower case filenames at the time. But the compiler accepted
> stdio.h in lower case. So that's potentially confusing. Schildt is
> telling his readers that they might see upper case, whilst telling
> them to prefer lower case. Which is correct enough.
He could simply have told them to use lower case for standard headers.
There is no good reason to even consider writing `#include <STDIO.H>`.
Schildt stated as "the traditional method" something that should be
treated, for simplicity, as an absolute rule.
If he wanted to abandon the simplification you advocate and discuss
the fact that the file (which users needn't even be aware of)
is named "STDIO.H", he could have gotten into that, and explained
that what appears between the <> isn't simply a file name. But all
a beginning programmer needs to know is that you need to write
#include <stdio.h>
at the top of the source file. C identifiers and keywords are
case-sensitive and usually lowercase; the fact that header names
follow the same pattern shouldn't confuse anyone.
You're grasping at straws.
>> > The books were very popular, and part of the reason is the informal style,
>> > avoiding over-qualification or the premature use of technical
>> > terms.
>>
>> But this example introduces more technical terms whose only purpose
>> appears to make a mistake. Surely it's just better to leave out any
>> talk about letter cases.
>>
>> And I find the part about the semi-colon and keywords defining
>> statements to be excessively technical without being particularly
>> clear.
>>
> He's just explained the anatomy of a C statement. It ends in a semi-colon.
> It's not always clear to a beginner where semicolons go and where
> they don't. They don't terminate #include directives. That of course
> is because these are preprocessing directives rather than actual
> C statements. But he's withholding some of the full truth there for
> pedagogical purposes. That's why the writing is clear and engaging.
C statements end in semicolons (except that compound statements
don't). So do declarations. So do the first two clauses of a
for statement. So do struct member definitions, due to a distinct
syntax rule separate from the one for declarations.
#include directives don't end in a semicolon because that's the syntax.
The underlying reason, which Schildt could have gone into if he had
wanted to, is that preprocessor directives are strictly line-oriented,
so there's no need for semicolons as a separator. His claim that it's
because "it is an instruction to the C compiler itself" is nonsense.
Everything in a C source file is an instruction to the C compiler.
And again, the *simple* way to explain it would be just to say that
a #include directive does not end in a semicolon. More generally,
preprocessor directives are line-oriented, begin with #, and do
not include semicolons as part of their syntax. His explanation
is both more complicated and wrong.
<sarcasm>But his writing is clear end engaging, so that's ok.<sarcasm>
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | bartc <bc@freeuk.com> |
|---|---|
| Date | 2018-04-27 19:04 +0100 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <QCJEC.220072$sl2.83541@fx46.am4> |
| In reply to | #129865 |
On 27/04/2018 18:36, Keith Thompson wrote:
> #include directives don't end in a semicolon because that's the syntax.
>
> The underlying reason, which Schildt could have gone into if he had
> wanted to, is that preprocessor directives are strictly line-oriented,
> so there's no need for semicolons as a separator. His claim that it's
> because "it is an instruction to the C compiler itself" is nonsense.
> Everything in a C source file is an instruction to the C compiler.
No, it isn't. If I say:
#include "FILE.H"
then /that's/ telling the compiler to go and locate that file and to
incorporate the contents into the source. If I say:
include("FILE.H");
then the compiler will /not/ execute this function call. It will make
arrangements for it to be executed at runtime.
So I think Schildt was right.
--
bartc
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2018-04-27 11:26 -0700 |
| Subject | Re: [Solved] Need some help getting to my feet |
| Message-ID | <lnvaccec9b.fsf@kst-u.example.com> |
| In reply to | #129866 |
bartc <bc@freeuk.com> writes:
> On 27/04/2018 18:36, Keith Thompson wrote:
>> #include directives don't end in a semicolon because that's the syntax.
>>
>> The underlying reason, which Schildt could have gone into if he had
>> wanted to, is that preprocessor directives are strictly line-oriented,
>> so there's no need for semicolons as a separator. His claim that it's
>> because "it is an instruction to the C compiler itself" is nonsense.
>> Everything in a C source file is an instruction to the C compiler.
>
> No, it isn't. If I say:
>
> #include "FILE.H"
>
> then /that's/ telling the compiler to go and locate that file and to
> incorporate the contents into the source. If I say:
>
> include("FILE.H");
>
> then the compiler will /not/ execute this function call. It will make
> arrangements for it to be executed at runtime.
It instructs the compiler to generate code to call the function.
> So I think Schildt was right.
I will admit that it's reasonable to say that preprocessor
directives are instructions to the compiler, while statements are
instructions to do something at compile time. I think my statement
that "Everything in a C source file is an instruction to the C
compiler." is strictly true, but it is a bit of a stretch.
In any case, that was a side point, and not particularly relevant.
Schildt's claim that preprocessor directives don't have semicolons
*because" they're instructions to the C compiler is nonsense.
The preprocessor's syntax could just as easily have been defined
using semicolons to terminate directives. (I'm not interested in
debating whether that would have been better.)
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
Page 3 of 7 — ← Prev page 1 2 [3] 4 5 6 7 Next page →
Back to top | Article view | comp.lang.c
csiph-web