Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #396684 > unrolled thread
| Started by | DFS <nospam@dfs.com> |
|---|---|
| First post | 2026-02-19 16:55 -0500 |
| Last post | 2026-03-16 09:04 +0100 |
| Articles | 20 on this page of 218 — 21 participants |
Back to article view | Back to comp.lang.c
Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-02-19 16:55 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-02-25 15:56 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-02-26 10:05 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-02-26 13:20 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 17:06 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 17:27 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-02-26 14:31 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-02-26 13:33 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 18:49 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 18:55 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 19:17 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 19:34 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 20:01 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 10:36 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 17:38 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 17:48 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-02-27 00:12 +0000
[OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-06 06:37 +0100
Re: [OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Bart <bc@freeuk.com> - 2026-03-06 15:48 +0000
Re: [OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-06 18:17 +0100
Re: [OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Bart <bc@freeuk.com> - 2026-03-06 21:46 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 00:44 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-02 11:07 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 06:35 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-02 17:50 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 21:15 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-03 20:48 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-03-03 22:47 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-04 08:48 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 01:07 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-04 12:09 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 11:19 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-04 12:58 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:31 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-04 13:20 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 08:30 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-04 14:36 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 10:02 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-04 19:27 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 13:49 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-05 21:02 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-05 20:39 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 19:24 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 13:54 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-12 05:50 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-13 11:58 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-13 23:00 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-15 15:54 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-15 23:42 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-06 12:02 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-15 15:43 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-02 17:40 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 21:09 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-03 08:23 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 06:20 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-03 23:56 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 15:51 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-04 11:45 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-04 07:01 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:37 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 08:29 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-03-04 16:02 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-04 08:09 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 10:34 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 08:46 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 11:25 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 13:46 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-05 21:34 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-05 19:09 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-05 21:12 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 14:12 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-05 22:24 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 01:00 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 15:08 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 15:05 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-06 00:18 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-07 22:04 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 00:26 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-08 02:45 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 17:05 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 07:57 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 00:12 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 00:14 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 20:31 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 13:51 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 08:53 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 19:36 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 18:14 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-07 18:21 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-07 11:55 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-07 20:10 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 10:44 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-07 12:02 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-07 20:14 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 10:53 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 16:58 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-08 00:35 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 08:23 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 00:40 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-08 10:42 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-08 15:18 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-08 12:21 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-08 19:29 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-09 21:20 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-10 14:43 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-10 18:08 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Giovanni <lsodgf0@home.net.it> - 2026-03-10 17:18 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-10 16:32 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-10 15:25 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 07:07 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-11 13:49 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-10 20:24 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-10 15:29 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-11 00:29 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-11 00:33 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-11 11:04 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway antispam@fricas.org (Waldek Hebisch) - 2026-03-10 20:18 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-12 05:37 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 17:57 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-08 13:19 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-09 01:12 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-08 21:42 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-03-08 15:58 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-09 08:09 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-09 08:53 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-03-09 15:25 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 14:40 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-12 05:55 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-08 16:00 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 12:44 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 17:36 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-08 13:27 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 06:33 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-08 12:22 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 06:27 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-07 16:43 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 07:29 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-11 14:22 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-25 10:07 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-25 15:54 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-30 03:13 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-06 16:02 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 12:11 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 13:01 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 13:28 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-06 21:53 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 22:14 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-07 07:33 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 10:24 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-07 19:16 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 14:18 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 00:47 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-09 22:18 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway Richard Harnden <richard.nospam@gmail.invalid> - 2026-03-10 10:14 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Richard Harnden <richard.nospam@gmail.invalid> - 2026-03-11 11:40 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-07 13:33 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Richard Harnden <richard.nospam@gmail.invalid> - 2026-03-07 14:53 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-07 15:44 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-07 19:53 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 10:22 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:40 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-11 11:00 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway wij <wyniijj5@gmail.com> - 2026-03-12 00:00 +0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 18:03 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-11 17:52 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway wij <wyniijj5@gmail.com> - 2026-03-12 23:14 +0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-12 16:23 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-12 16:11 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 14:04 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:36 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:35 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-03 15:40 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 16:23 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-04 15:31 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-04 09:38 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-03 16:39 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-03 12:00 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-04 11:44 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 17:44 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 15:13 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 21:07 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-04 23:37 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 07:32 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 08:23 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 02:24 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 08:46 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 09:52 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway tTh <tth@none.invalid> - 2026-03-05 10:49 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 11:03 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway gazelle@shell.xmission.com (Kenny McCormack) - 2026-03-05 15:22 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 05:06 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 11:13 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 14:11 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 03:35 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-05 14:49 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-05 19:27 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 19:46 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway tTh <tth@none.invalid> - 2026-03-05 20:50 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-05 22:34 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 07:48 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 11:49 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 13:41 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 15:33 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 14:42 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 13:49 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-06 02:17 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 20:06 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-06 14:58 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 17:13 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 08:37 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-03 17:29 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-03 19:20 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 16:26 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-04 05:27 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Opus <ifonly@youknew.org> - 2026-03-04 22:42 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway peter <peter.noreply@tin.it> - 2026-03-14 10:42 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-15 15:09 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-16 09:04 +0100
Page 10 of 11 — ← Prev page 1 … 8 9 [10] 11 Next page →
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-04 21:07 -0500 |
| Message-ID | <10oaogg$3eem2$2@dont-email.me> |
| In reply to | #396770 |
On 3/4/2026 6:13 PM, Keith Thompson wrote: > DFS <nospam@dfs.com> writes: >> On 3/4/2026 5:44 AM, Bonita Montero wrote: >> >> <code below> >> >> >> Your first code compiled fine >> >> $ g++ rc-montero1.cpp -o rc >> $ >> >> >> but this one tossed out a lot of errors. >> >> >> $ g++ rc-montero2.cpp -o rc >> >> rc-montero2.cpp:13:1: error: extended character is not valid in an >> identifier >> 13 | if( argc < 3 ) >> | ^ > [277 lines deleted] > > Apparently the code you compiled contained NO-BREAK-SPACE (U+00a0) > characters, and your compiler didn't tolerate them. You're right - I forgot I had to fix Montero's code the first time. Notepad++ shows them as NBSP characters. > You really really didn't need to post hundreds of lines of error > messages to make that point -- especially since the code was C++ > and should never have been posted to comp.lang.c in the first place. If I make Montero cry am I forgiven?
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2026-03-04 23:37 +0000 |
| Message-ID | <Am3qR.75496$8JW1.67972@fx12.iad> |
| In reply to | #396769 |
DFS <nospam@dfs.com> writes: >On 3/4/2026 5:44 AM, Bonita Montero wrote: > ><code below> > > >Your first code compiled fine > >$ g++ rc-montero1.cpp -o rc >$ > > >but this one tossed out a lot of errors. > > >$ g++ rc-montero2.cpp -o rc > >rc-montero2.cpp:13:1: error: extended character is not valid in an >identifier > 13 | if( argc < 3 ) Probably junk inserted by your browser or due to the use of an odd charset or character encoding to create the post. Replace those characters with whitespace characters to get past that error.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 07:32 +0100 |
| Message-ID | <10ob81t$3iool$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396769 |
It was thunderbird which made a NBSP-row out of my tabs.
Here my final code, somewhat more simplified.
#include <iostream>
#include <thread>
#include <sstream>
#include <iomanip>
#include <optional>
#include <algorithm>
using namespace std;
static optional<size_t> parse( const char *str );
int main( int argc, char **argv )
{
if( argc < 3 )
return EXIT_FAILURE;
optional<size_t>
rows = parse( argv[1] ),
cols = parse( argv[2] );
if( !rows || !*rows || !cols || !*cols )
return EXIT_FAILURE;
size_t clip = *rows * *cols;
if( argc >= 4 )
if( optional<size_t> pClip = parse( argv[3] ); pClip && *pClip )
clip = (*pClip <= clip ? *pClip : clip) + 1;
else
return EXIT_FAILURE;
size_t nMtx = *rows * *cols;
clip = clip <= nMtx ? clip : nMtx;
unsigned width = [&]
{
ostringstream oss;
oss << clip - 1;
return (unsigned)oss.str().length();
}();
for( size_t row = 0; row < min( *rows, clip ); ++row )
{
bool head = true;
for( size_t value = row; value < min( nMtx, clip ); value +=
*rows, head = false )
cout << " "sv.substr( head, !head ) << right << setw( width
) << value;
cout << endl;
}
}
static optional<size_t> parse( const char *str )
{
istringstream iss( str );
size_t ret;
iss >> ret;
if( !iss || !iss.eof() )
return nullopt;
return ret;
}
I especially like the sub-statement:
" "sv.substr( head, !head )
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 08:23 +0100 |
| Message-ID | <10obb1a$3jksn$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396773 |
Am 05.03.2026 um 07:32 schrieb Bonita Montero:
> It was thunderbird which made a NBSP-row out of my tabs.
> unsigned width = [&]
> {
> ostringstream oss;
> oss << clip - 1;
> return (unsigned)oss.str().length();
> }();
Even simpler:
unsigned width = (unsigned)(ostringstream() << clip - 1).str().length();
C++ really rocks !
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-05 02:24 -0500 |
| Message-ID | <10obb37$3jler$1@dont-email.me> |
| In reply to | #396753 |
On 3/4/2026 5:44 AM, Bonita Montero wrote:
> Now it fits:
Almost.
With no stop you print 0 to input-1
$./rc 1 3
0, 1, 2
With stop you print 0 to stop
$ ./rc 5 1 3
0
1
2
3
Both inputs should print 3 numbers.
> That's C++: less and more readable code.
<53 lines of almost unreadable C++ snipped>
-------------------------------------------------------------------
My 29 lines of C that matches the functionality of your 53 lines
-------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
if (argc < 3 || argc > 4) {
printf("Enter 2 or 3 arguments:\n$./prog rows columns [stop]\n");
return 0;
}
int rows = atoi(argv[1]);
int cols = atoi(argv[2]);
int max = (argc == 4) ? atoi(argv[3]) : rows * cols ;
char cw[6];
int colwidth = sprintf(cw,"%d",max) + 1;
for (int r = 1; r <= rows; r++) {
if (r <= max) {
int nbr = r;
printf("%*d",colwidth,nbr);
for (int i = 0; i < cols-1; i++) {
nbr += rows;
(nbr <= max) ? printf("%*d",colwidth,nbr) : 0 ;
}
printf("\n");
}
else
{
break;
}
}
return 0;
}
----------------------------------------------------------
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 08:46 +0100 |
| Message-ID | <10obcco$3k1b3$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396775 |
Am 05.03.2026 um 08:24 schrieb DFS:
> On 3/4/2026 5:44 AM, Bonita Montero wrote:
>
>> Now it fits:
>
> Almost.
>
> With no stop you print 0 to input-1
> $./rc 1 3
> 0, 1, 2
>
> With stop you print 0 to stop
> $ ./rc 5 1 3
> 0
> 1
> 2
> 3
>
> Both inputs should print 3 numbers.
>
>
>
>> That's C++: less and more readable code.
>
>
> <53 lines of almost unreadable C++ snipped>
>
>
> -------------------------------------------------------------------
> My 29 lines of C that matches the functionality of your 53 lines
> -------------------------------------------------------------------
> #include <stdlib.h>
> #include <stdio.h>
> int main(int argc, char *argv[]) {
> if (argc < 3 || argc > 4) {
> printf("Enter 2 or 3 arguments:\n$./prog rows columns [stop]\n");
> return 0;
> }
> int rows = atoi(argv[1]);
> int cols = atoi(argv[2]);
> int max = (argc == 4) ? atoi(argv[3]) : rows * cols ;
> char cw[6];
> int colwidth = sprintf(cw,"%d",max) + 1;
> for (int r = 1; r <= rows; r++) {
> if (r <= max) {
> int nbr = r;
> printf("%*d",colwidth,nbr);
> for (int i = 0; i < cols-1; i++) {
> nbr += rows;
> (nbr <= max) ? printf("%*d",colwidth,nbr) : 0 ;
> }
> printf("\n");
> }
> else
> {
> break;
> }
> }
> return 0;
> }
> ----------------------------------------------------------
>
This is more readable and *with* error handling while parsing the
parameters. You don't have that.
#include <iostream>
#include <thread>
#include <sstream>
#include <iomanip>
#include <optional>
#include <algorithm>
using namespace std;
static optional<size_t> parse( const char *str );
int main( int argc, char **argv )
{
if( argc < 3 )
return EXIT_FAILURE;
optional<size_t>
rows = parse( argv[1] ),
cols = parse( argv[2] );
if( !rows || !*rows || !cols || !*cols )
return EXIT_FAILURE;
size_t clip = *rows * *cols;
if( argc >= 4 )
if( optional<size_t> psClip = parse( argv[3] ); psClip && *psClip )
clip = (*psClip <= clip ? *psClip : clip) + 1;
else
return EXIT_FAILURE;
size_t nMtx = *rows * *cols;
clip = clip <= nMtx ? clip : nMtx;
unsigned width = (unsigned)(ostringstream() << clip - 1).str().length();
for( size_t row = 0; row < min( *rows, clip ); ++row )
{
bool head = true;
for( size_t value = row; value < min( nMtx, clip ); value += *rows,
head = false )
cout << " "sv.substr( head, !head ) << right << setw( width ) << value;
cout << endl;
}
}
static optional<size_t> parse( const char *str )
{
istringstream iss( str );
size_t ret;
iss >> ret;
if( !iss || !iss.eof() )
return nullopt;
return ret;
}
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 09:52 +0100 |
| Message-ID | <10obg7k$3l9p4$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396776 |
Now it's even shorter - and still *with* error handling:
#include <iostream>
#include <sstream>
#include <iomanip>
#include <optional>
#include <algorithm>
using namespace std;
static optional<size_t> parse( const char *str );
int main( int argc, char **argv )
{
if( argc < 3 )
return EXIT_FAILURE;
optional<size_t>
rows = parse( argv[1] ),
cols = parse( argv[2] ),
clip;
if( !rows || !*rows || !cols || !*cols )
return EXIT_FAILURE;
clip.emplace( *rows * *cols );
if( argc >= 4 && (!(clip = parse( argv[3] )) || !*clip) )
return EXIT_FAILURE;
*clip = min( *clip, *rows * *cols );
unsigned width = (unsigned)(ostringstream() << *clip - 1).str().length();
for( size_t row = 0; row < min( *rows, *clip ); ++row )
{
bool head = true;
for( size_t value = row; value < *clip; value += *rows, head = false )
cout << " "sv.substr( head, !head ) << right << setw( width ) << value;
cout << endl;
}
}
static optional<size_t> parse( const char *str )
{
istringstream iss( str );
size_t ret;
iss >> ret;
if( !iss || !iss.eof() )
return nullopt;
return ret;
}
If you're familiar with C++ this code is more readable.
And the C++ streams are type safe, C streams not.
[toc] | [prev] | [next] | [standalone]
| From | tTh <tth@none.invalid> |
|---|---|
| Date | 2026-03-05 10:49 +0100 |
| Message-ID | <10objjj$hie$1@news.gegeweb.eu> |
| In reply to | #396777 |
On 3/5/26 09:52, Bonita Montero wrote:
> Now it's even shorter - and still *with* error handling:
>
> #include <iostream>
And *still* in the wrong group.
--
** **
* tTh des Bourtoulots *
* http://maison.tth.netlib.re/ *
** **
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 11:03 +0100 |
| Message-ID | <10obkcr$3mn0k$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396778 |
Am 05.03.2026 um 10:49 schrieb tTh: > And *still* in the wrong group. I'm impressed about how far your reading goes.
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2026-03-05 15:22 +0000 |
| Message-ID | <10oc74c$6js$1@news.xmission.com> |
| In reply to | #396778 |
In article <10objjj$hie$1@news.gegeweb.eu>, tTh <tth@none.invalid> wrote: >On 3/5/26 09:52, Bonita Montero wrote: >> Now it's even shorter - and still *with* error handling: >> >> #include <iostream> > > And *still* in the wrong group. Bonita obviously don't care. That ship has long since sailed. No point in continuing to harp on it. BTW, it seems to me that Bonita takes the view that C is merely a concept, and that C++ is the current implementation of that concept. I've taken this sort of view myself, in other forums, in other contexts. It can be a useful mental framework. -- BigBusiness types (aka, Republicans/Conservatives/Independents/Liberatarians/whatevers) don't hate big government. They *love* big government as a means for them to get rich, sucking off the public teat. What they don't like is *democracy* - you know, like people actually having the right to vote and stuff like that.
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-05 05:06 -0500 |
| Message-ID | <10obkj0$3mnq9$1@dont-email.me> |
| In reply to | #396776 |
On 3/5/2026 2:46 AM, Bonita Montero wrote:
> Am 05.03.2026 um 08:24 schrieb DFS:
>> On 3/4/2026 5:44 AM, Bonita Montero wrote:
>>
>>> Now it fits:
>>
>> Almost.
>>
>> With no stop you print 0 to input-1
>> $./rc 1 3
>> 0, 1, 2
>>
>> With stop you print 0 to stop
>> $ ./rc 5 1 3
>> 0
>> 1
>> 2
>> 3
>>
>> Both inputs should print 3 numbers.
>>
>>
>>
>>> That's C++: less and more readable code.
>>
>>
>> <53 lines of almost unreadable C++ snipped>
>>
>>
>> -------------------------------------------------------------------
>> My 29 lines of C that matches the functionality of your 53 lines
>> -------------------------------------------------------------------
>> #include <stdlib.h>
>> #include <stdio.h>
>> int main(int argc, char *argv[]) {
>> if (argc < 3 || argc > 4) {
>> printf("Enter 2 or 3 arguments:\n$./prog rows columns
>> [stop]\n");
>> return 0;
>> }
>> int rows = atoi(argv[1]);
>> int cols = atoi(argv[2]);
>> int max = (argc == 4) ? atoi(argv[3]) : rows * cols ;
>> char cw[6];
>> int colwidth = sprintf(cw,"%d",max) + 1;
>> for (int r = 1; r <= rows; r++) {
>> if (r <= max) {
>> int nbr = r;
>> printf("%*d",colwidth,nbr);
>> for (int i = 0; i < cols-1; i++) {
>> nbr += rows;
>> (nbr <= max) ? printf("%*d",colwidth,nbr) : 0 ;
>> }
>> printf("\n");
>> }
>> else
>> {
>> break;
>> }
>> }
>> return 0;
>> }
>> ----------------------------------------------------------
>>
>
> This is more readable
Definitely not. But if you indented correctly it would be easier to read.
Win for C either way.
> and *with* error handling while parsing the
> parameters. You don't have that.
Yes I do. Lines 4-7. And it actually works better than yours.
Wrong # of inputs and your program just quits.
Wrong # of inputs and my program shows you what to do.
Win for DFS
------------------------------------------------------------------------
Invalid inputs (such as ./rc a b c) and both our programs just quit.
Tie
------------------------------------------------------------------------
You pull in 6 headers, vs my 2.
Win for C
------------------------------------------------------------------------
You use 10 variables: rows, cols, clip, psClip, nMtx, width, row, head,
value, ret
I use 8 variables: rows, cols, max, cw, colwidth, r, nbr, i
Win for DFS
------------------------------------------------------------------------
Changing the start value of your code from 0 to 1 results in 1 fewer
rows than input.
Changing the start value of my code from 1 to 0 results in 1 extra row
than input.
Tie
------------------------------------------------------------------------
I didn't time them, but both programs feel about the same speed, with
and without printf() and cout.
Tie
------------------------------------------------------------------------
Both our programs apparently correctly print very large matrices. I
tried 10000 x 10000 and they both ran all the way thru. But because I
set a char to 6 (not considering massive matrices), my program generated
a buffer overflow and a "stack smashing detected" error at the very end
for values >= 1,000,000.
Yours never did.
unsigned width = (unsigned)(ostringstream() << clip - 1).str().length();
saved your ass.
Changed the size of my char variable 'cw' from 6 to 12 and no more messages.
Win for Montero and C++
------------------------------------------------------------------------
Your line count is 42
My line count is 29 (31% shorter).
Win for C
------------------------------------------------------------------------
Your compiled code is 32,304 bytes.
My compiled code is 16,176 bytes.
Win for C
------------------------------------------------------------------------
The output of g++ -S rc-montero.cpp is 2092 lines
The output of gcc -S rc-dfs.c is 152 lines
Win for C
------------------------------------------------------------------------
11 comparisons
C/DFS vs C++/Montero win-loss-tie: 7-1-3
Overall it's a total beatdown!
You may need to rethink your commitment to C++, and apologize for your
aggressive trolling of comp.lang.c.
> #include <iostream>
> #include <thread>
> #include <sstream>
> #include <iomanip>
> #include <optional>
> #include <algorithm>
>
> using namespace std;
>
> static optional<size_t> parse( const char *str );
>
> int main( int argc, char **argv )
> {
> if( argc < 3 )
> return EXIT_FAILURE;
> optional<size_t>
> rows = parse( argv[1] ),
> cols = parse( argv[2] );
> if( !rows || !*rows || !cols || !*cols )
> return EXIT_FAILURE;
> size_t clip = *rows * *cols;
> if( argc >= 4 )
> if( optional<size_t> psClip = parse( argv[3] ); psClip &&
> *psClip )
> clip = (*psClip <= clip ? *psClip : clip) + 1;
> else
> return EXIT_FAILURE;
> size_t nMtx = *rows * *cols;
> clip = clip <= nMtx ? clip : nMtx;
> unsigned width = (unsigned)(ostringstream() << clip -
> 1).str().length();
> for( size_t row = 0; row < min( *rows, clip ); ++row )
> {
> bool head = true;
> for( size_t value = row; value < min( nMtx, clip ); value +=
> *rows, head = false )
> cout << " "sv.substr( head, !head ) << right << setw( width
> ) << value;
> cout << endl;
> }
> }
>
> static optional<size_t> parse( const char *str )
> {
> istringstream iss( str );
> size_t ret;
> iss >> ret;
> if( !iss || !iss.eof() )
> return nullopt;
> return ret;
> }
>
>
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 11:13 +0100 |
| Message-ID | <10obl0g$3mri7$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396780 |
Am 05.03.2026 um 11:06 schrieb DFS: > Definitely not. But if you indented correctly it would be easier to read. > Win for C either way. Absolutely not. It's the typical C code which is prone to buffer-over- flows (sprintf) and there's no checking of the validity of the command- line-parameters. But usually C++ is about five times less code since there are no built -in complex containers like a map<> or an unordered_map in C. If you want to to that in C you have to stick with external libraries which do the polymorphic behaviour with callbacks (slower). That's the most popular reason C++ is mostly much less code, but there a few further.
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-05 14:11 -0500 |
| Message-ID | <10ockhb$1ke5$3@dont-email.me> |
| In reply to | #396781 |
On 3/5/2026 5:13 AM, Bonita Montero wrote: > Am 05.03.2026 um 11:06 schrieb DFS: > >> Definitely not. But if you indented correctly it would be easier to >> read. >> Win for C either way. > > Absolutely not. Both are fugly, but C++ much moreso. > It's the typical C code which is prone to buffer-over- > flows (sprintf) s/typical/untested > and there's no checking of the validity of the command- > line-parameters. ? You can validate command line arguments all day and night with C. > But usually C++ is about five times less code You're getting desperate. > since there are no built > -in complex containers like a map<> or an unordered_map in C. If you > want to to that in C you have to stick with external libraries which > do the polymorphic behaviour with callbacks (slower). External library not necessary. It's a little bit of code, such as: https://www.geeksforgeeks.org/dsa/implementation-on-map-or-dictionary-data-structure-in-c/ > That's the most popular reason C++ is mostly much less code, but there a few further. Accept your beatdown. Learn some humility.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-06 03:35 +0100 |
| Message-ID | <10odegu$aqcm$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396790 |
Am 05.03.2026 um 20:11 schrieb DFS: >> It's the typical C code which is prone to buffer-over- >> flows (sprintf) > s/typical/untested Then write assembly and say that's all a matter of testing. >> But usually C++ is about five times less code >> since there are no built >> -in complex containers like a map<> or an unordered_map in C. If you >> want to to that in C you have to stick with external libraries which >> do the polymorphic behaviour with callbacks (slower). > External library not necessary. It's a little bit of code, such as: > https://www.geeksforgeeks.org/dsa/implementation-on-map-or-dictionary- > data-structure-in-c/ Five seconds in C++: unordered_map<Key, Value> um; um.emplace( k, v );
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2026-03-05 14:49 +0000 |
| Message-ID | <JJgqR.175509$mGtd.93389@fx23.iad> |
| In reply to | #396775 |
DFS <nospam@dfs.com> writes: >On 3/4/2026 5:44 AM, Bonita Montero wrote: > int colwidth = sprintf(cw,"%d",max) + 1; using ciel(log10(rows*columns)) performs better than snprintf in this application. $ printf '%f\n' $(( ceil(log10( 8*8)) )) 2.000000
[toc] | [prev] | [next] | [standalone]
| From | Janis Papanagnou <janis_papanagnou@hotmail.com> |
|---|---|
| Date | 2026-03-05 19:27 +0100 |
| Message-ID | <10ochv8$1dga$1@dont-email.me> |
| In reply to | #396782 |
On 05.03.26 15:49, Scott Lurndal wrote:
> DFS <nospam@dfs.com> writes:
>> On 3/4/2026 5:44 AM, Bonita Montero wrote:
>
>> int colwidth = sprintf(cw,"%d",max) + 1;
>
> using ciel(log10(rows*columns)) performs better than snprintf
> in this application.
>
> $ printf '%f\n' $(( ceil(log10( 8*8)) ))
> 2.000000
Just two remarks. These two function variants are called just once,
so there's hardly any performance issue in this case. And note that
the original program uses no reals/floats at all; usually I try to
stay within a minimum required feature set, here concerning the used
types, the float functions and %f formatter, that I'd avoid. (YMMV.
No biggie anyway.)
With *printf's definition I actually like the sprintf variant; to me
it appears to be clearer. For the float-expression I'd certainly add
a comment.
BTW, since you're using shell code to demonstrate your idea; with
the shell I'm typically using a "string / no math variant" of DFS'
code to determine the length
max=$(( 8*8 ))
colwidth=${#max}
(where there's of course no printf or math functions necessary in
shell). (Upthread folks were talking about readability.)
Janis
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-05 19:46 +0100 |
| Message-ID | <10ocj2t$1qd4$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396782 |
Am 05.03.2026 um 15:49 schrieb Scott Lurndal: > DFS <nospam@dfs.com> writes: >> On 3/4/2026 5:44 AM, Bonita Montero wrote: > >> int colwidth = sprintf(cw,"%d",max) + 1; > > using ciel(log10(rows*columns)) performs better than snprintf > in this application. > > > $ printf '%f\n' $(( ceil(log10( 8*8)) )) > 2.000000 > Don't do that with 64 bit integrals and a FPU which has 53 bits mantissa.
[toc] | [prev] | [next] | [standalone]
| From | tTh <tth@none.invalid> |
|---|---|
| Date | 2026-03-05 20:50 +0100 |
| Message-ID | <10ocmpu$1c00$1@news.gegeweb.eu> |
| In reply to | #396786 |
On 3/5/26 19:46, Bonita Montero wrote:
>> $ printf '%f\n' $(( ceil(log10( 8*8)) ))
>> 2.000000
>>
>
> Don't do that with 64 bit integrals and a FPU which has 53 bits mantissa.
Why ?
--
** **
* tTh des Bourtoulots *
* http://maison.tth.netlib.re/ *
** **
[toc] | [prev] | [next] | [standalone]
| From | Michael S <already5chosen@yahoo.com> |
|---|---|
| Date | 2026-03-05 22:34 +0200 |
| Message-ID | <20260305223426.00004997@yahoo.com> |
| In reply to | #396791 |
On Thu, 5 Mar 2026 20:50:22 +0100 tTh <tth@none.invalid> wrote: > On 3/5/26 19:46, Bonita Montero wrote: > > >> $ printf '%f\n' $(( ceil(log10( 8*8)) )) > >> 2.000000 > >> > > > > Don't do that with 64 bit integrals and a FPU which has 53 bits > > mantissa. > > Why ? > I don't understand why this formula is good even for smaller numbers. For example, ceil(log10(10*10)) returns 2. Desired answer is 3. But at least for small numbers the formula gives a wrong answer only when x*y is an exact power of 10. For big numbers it can miscalculate in other cases as well. E.g. (20877*478996024333). Of course, considering the entire problem, really big row*col is a bad idea for more prosaic reason than inaccuracy of double precisions calculations. The reason is that neither you nor your computer will live long enough to see/print the whole output.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2026-03-06 07:48 +0100 |
| Message-ID | <10odtb0$evg6$1@raubtier-asyl.eternal-september.org> |
| In reply to | #396791 |
Am 05.03.2026 um 20:50 schrieb tTh: > On 3/5/26 19:46, Bonita Montero wrote: > >>> $ printf '%f\n' $(( ceil(log10( 8*8)) )) >>> 2.000000 >>> >> >> Don't do that with 64 bit integrals and a FPU which has 53 bits mantissa. > > Why ? Because the 53 bits may mistakenly represent a power of ten because the lower bits were dropped.
[toc] | [prev] | [next] | [standalone]
Page 10 of 11 — ← Prev page 1 … 8 9 [10] 11 Next page →
Back to top | Article view | comp.lang.c
csiph-web