Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #391319 > unrolled thread

Suggested method for returning a string from a C program?

Started byDFS <nospam@dfs.com>
First post2025-03-18 21:38 -0400
Last post2025-03-23 12:29 -0400
Articles 20 on this page of 422 — 23 participants

Back to article view | Back to comp.lang.c


Contents

  Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-18 21:38 -0400
    Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-18 19:05 -0700
      Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-18 19:22 -0700
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-18 22:43 -0400
        Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-18 20:11 -0700
    Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-18 20:07 -0700
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-18 23:34 -0400
        Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 04:01 +0000
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 00:38 -0400
        Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-18 22:27 -0700
          Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 13:23 -0400
            Re: Suggested method for returning a string from a C program? James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-19 13:40 -0400
              Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-19 11:56 -0700
              Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 15:06 -0400
            Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-19 12:52 -0700
        Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-19 11:55 +0200
          Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 13:23 -0400
            Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 17:38 +0000
              Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-19 20:19 +0200
                Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 19:03 +0000
                Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 05:09 -0700
                  Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 12:23 +0000
                    Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-20 13:36 +0000
                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 14:00 +0000
                        Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-20 14:32 +0000
                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 15:11 +0000
                            Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-24 16:37 +0100
                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-24 16:14 +0000
                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-24 17:20 +0100
                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-24 21:56 -0700
                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 08:45 +0100
                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-25 09:08 +0100
                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 19:55 +0100
                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 09:18 +0100
                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-25 08:39 +0000
                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-25 03:51 -0700
                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-25 13:11 +0200
                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-25 05:02 -0700
                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-25 16:33 +0100
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 20:04 +0100
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 09:23 +0100
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 13:31 -0700
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 09:34 +0100
                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 02:59 -0700
                                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 12:33 +0100
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 15:59 +0100
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 17:37 +0100
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 12:38 -0700
                                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 22:53 +0100
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 15:15 -0700
                                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-27 10:11 +0100
                                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-29 18:25 +0100
                                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-29 18:20 +0000
                                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-30 01:39 +0100
                                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Alan Mackenzie <acm@muc.de> - 2025-03-31 17:15 +0000
                                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-31 19:48 +0000
                                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-31 21:14 +0000
                                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-31 14:56 -0700
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-26 14:07 -0400
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-26 17:58 +0000
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-26 14:20 -0400
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 12:42 -0700
                                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-26 17:36 +0000
                                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-27 13:48 -0400
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-27 18:31 +0000
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-29 10:14 -0400
                                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-29 16:39 +0000
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-29 21:02 -0400
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-27 12:31 -0700
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-27 20:06 +0000
                                                      Newsgroup etiquette Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-28 11:03 -0700
                                                        Re: Newsgroup etiquette Richard Heathfield <rjh@cpax.org.uk> - 2025-03-28 18:39 +0000
                                                          Re: Newsgroup etiquette Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-28 18:45 +0000
                                                          Re: Newsgroup etiquette Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-04-27 12:28 -0700
                                                            Re: Newsgroup etiquette Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-27 14:40 -0700
                                                            Re: Newsgroup etiquette Ethan Carter <ec1828@somewhere.edu> - 2025-04-28 00:59 -0300
                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 15:58 +0100
                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-25 19:09 +0200
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-25 17:34 +0000
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-25 19:49 +0000
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-25 12:53 -0700
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 13:39 -0700
                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-02-07 00:04 -0800
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-25 13:23 -0700
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 09:50 +0100
                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-25 16:22 +0000
                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-25 18:18 +0000
                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 19:55 +0100
                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 13:41 -0700
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 23:35 +0100
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 16:38 -0700
                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-25 19:55 -0400
                                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 10:00 +0100
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-26 16:01 +0200
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 14:45 +0000
                                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-26 17:16 +0200
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-26 08:55 -0700
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 17:45 +0100
                                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 17:22 +0000
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 17:19 +0000
                                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 17:40 +0100
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 17:25 +0000
                                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 21:27 +0100
                                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 20:34 +0000
                                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 13:50 -0700
                                                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 21:04 +0000
                                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 14:12 -0700
                                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-26 21:18 +0000
                                                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-26 23:22 +0200
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-26 14:38 -0400
                                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-26 18:52 +0000
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 17:32 +0100
                                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) antispam@fricas.org (Waldek Hebisch) - 2025-03-26 22:29 +0000
                                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-26 14:31 -0400
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 21:33 +0100
                                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-28 15:42 +0000
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-25 19:52 -0400
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 17:16 -0700
                                  Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-25 04:55 -0700
                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 13:48 -0700
                                    Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-25 21:52 +0000
                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-25 22:36 +0000
                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-03-25 23:14 +0000
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 10:09 +0100
                                      Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-03 20:03 -0700
                                        Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-05-04 14:04 +0200
                                          Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-05-04 15:43 +0100
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-05-04 18:39 +0200
                                              Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Richard Heathfield <rjh@cpax.org.uk> - 2025-05-04 19:02 +0100
                                                Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-05-05 11:29 +0200
                                            Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-15 23:02 -0700
                        Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 14:50 +0000
                          Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-20 16:59 +0200
                            Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 15:16 +0000
                              Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-20 17:29 +0200
                                Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 15:55 +0000
                                  Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-23 11:01 +0200
                                    Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-23 12:56 -0700
                                Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 11:47 -0700
                                Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 12:28 -0700
                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 15:40 +0000
                            Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 15:57 +0000
                            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-20 20:46 +0200
                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 19:15 +0000
                                Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-20 19:58 +0000
                                  Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-20 22:57 +0200
                                    Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-20 21:10 +0000
                                Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 16:10 -0700
                                  The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-24 16:59 +0100
                                    Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-24 15:57 -0700
                                      Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-25 10:38 +0100
                                        Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-25 16:31 +0000
                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-25 19:23 +0100
                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 13:14 -0700
                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-25 23:50 -0700
                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 10:33 +0100
                                        Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 19:18 +0100
                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-25 18:50 +0000
                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 20:45 +0100
                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-25 23:30 +0000
                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 14:59 +0100
                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 11:29 +0100
                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 15:08 +0100
                                                  Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 17:50 +0100
                                                    Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 19:09 +0100
                                                      Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 21:39 +0100
                                                      Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-26 23:21 +0000
                                                        Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-26 23:51 +0000
                                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-27 00:32 +0000
                                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-27 13:51 +0000
                                                        Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) antispam@fricas.org (Waldek Hebisch) - 2025-03-27 01:10 +0000
                                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-27 01:33 +0000
                                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-27 10:54 +0100
                                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-27 14:09 +0000
                                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) antispam@fricas.org (Waldek Hebisch) - 2025-03-28 17:49 +0000
                                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-27 14:07 +0000
                                                        Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-27 03:24 +0100
                                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-27 11:14 +0000
                                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) scott@slp53.sl.home (Scott Lurndal) - 2025-03-27 14:14 +0000
                                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 02:05 +0100
                                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-28 10:13 +0100
                                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 11:22 +0100
                                                                  Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-28 14:32 +0300
                                                                    Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 13:42 +0100
                                                                  Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-28 11:37 +0000
                                                                    Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 13:53 +0100
                                                                  Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-28 13:00 +0100
                                                                    Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 14:06 +0100
                                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-28 10:05 -0700
                                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-28 12:19 +0000
                                                              [OT] PC hardware prices [correction] (was Re: The integral type 'byte') Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-31 21:35 +0200
                                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-27 15:04 +0100
                                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 02:59 +0100
                                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-27 19:03 -0700
                                                                [OT] SPARC (was Re: The integral type 'byte') Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 03:26 +0100
                                                                  Re: [OT] SPARC (was Re: The integral type 'byte') Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-27 23:14 -0700
                                                                  Re: [OT] SPARC (was Re: The integral type 'byte') Michael S <already5chosen@yahoo.com> - 2025-03-28 13:26 +0300
                                                                    Re: [OT] SPARC (was Re: The integral type 'byte') David Brown <david.brown@hesbynett.no> - 2025-03-28 13:08 +0100
                                                                      Re: [OT] SPARC (was Re: The integral type 'byte') Michael S <already5chosen@yahoo.com> - 2025-03-28 15:20 +0300
                                                                        Re: [OT] SPARC (was Re: The integral type 'byte') David Brown <david.brown@hesbynett.no> - 2025-03-28 15:33 +0100
                                                                          Re: [OT] SPARC (was Re: The integral type 'byte') "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-28 10:26 -0700
                                                                            Re: [OT] SPARC (was Re: The integral type 'byte') "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-28 10:27 -0700
                                                                            Re: [OT] SPARC (was Re: The integral type 'byte') Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-28 18:44 +0000
                                                                          Re: [OT] SPARC (was Re: The integral type 'byte') Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-28 17:46 +0000
                                                                      Re: [OT] SPARC (was Re: The integral type 'byte') Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-28 17:45 +0000
                                                                    Re: [OT] SPARC (was Re: The integral type 'byte') Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 13:20 +0100
                                                                      Re: [OT] SPARC (was Re: The integral type 'byte') Michael S <already5chosen@yahoo.com> - 2025-03-28 15:56 +0300
                                                                        Re: [OT] SPARC (was Re: The integral type 'byte') Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 14:20 +0100
                                                                          Re: [OT] SPARC (was Re: The integral type 'byte') David Brown <david.brown@hesbynett.no> - 2025-03-28 15:43 +0100
                                                                        Re: [OT] SPARC (was Re: The integral type 'byte') Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-28 17:54 +0000
                                                                  Re: [OT] SPARC (was Re: The integral type 'byte') "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-28 10:16 -0700
                                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-28 11:03 +0100
                                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-28 14:01 +0300
                                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-28 11:29 +0000
                                                                  Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 12:46 +0100
                                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-28 12:30 +0100
                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 11:10 +0100
                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Richard Harnden <richard.nospam@gmail.invalid> - 2025-03-26 11:02 +0000
                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 12:47 +0100
                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) bart <bc@freeuk.com> - 2025-03-26 13:12 +0000
                                                  Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 14:48 +0100
                                                Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 15:40 +0100
                                              Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-26 18:29 +0000
                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 15:22 +0100
                                            Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-26 13:09 -0700
                                        Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-25 13:16 -0700
                                          Re: The integral type 'byte' (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 11:33 +0100
                            Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 12:22 -0700
                        Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 12:10 -0700
                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 20:59 +0000
                            Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 16:18 -0700
                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-20 23:55 +0000
                                Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-21 00:46 +0000
                                  Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-21 01:23 +0000
                                    Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 18:47 -0700
                                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-21 11:53 +0000
                                        Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-21 12:04 -0700
                                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 00:23 +0000
                                            Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-21 20:50 -0700
                                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 13:06 +0000
                                                Re: Suggested method for returning a string from a C program? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-22 14:51 -0700
                                                Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-22 14:52 -0700
                                                  Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-23 01:34 +0000
                                                    Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-23 10:50 +0200
                                                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-23 11:25 +0000
                                                        Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-23 14:12 +0200
                                                    Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-24 12:51 +0100
                                                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-24 14:07 +0000
                                                        Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-24 15:32 +0100
                                                          Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-24 15:00 +0000
                                                            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-24 17:22 +0200
                                                              Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-24 16:12 +0000
                                                            Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-24 16:02 +0000
                                                              Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-24 16:17 +0000
                                                                Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-24 16:49 +0000
                                                                  Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-24 16:56 +0000
                                                                    Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-24 18:20 +0000
                                                                      Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-25 08:40 +0000
                                                                        Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 11:09 +0000
                                                                          Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-25 14:46 +0000
                                                                            Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 15:04 +0000
                                                                              Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-25 15:09 +0000
                                                                                Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 16:40 +0000
                                                                                  Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-26 09:20 +0000
                                                                                    Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-26 10:07 +0000
                                                                                    Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-26 18:06 +0000
                                                                                      Re: Suggested method for returning a string from a C program? antispam@fricas.org (Waldek Hebisch) - 2025-03-27 00:22 +0000
                                                                                        Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-27 14:22 +0000
                                                                                          Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-27 10:54 -0700
                                                                                            Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-28 16:13 +0000
                                                                                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-28 16:40 +0000
                                                                                                Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-28 20:41 +0000
                                                                                                  Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-28 22:18 +0000
                                                                                                    Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-28 15:33 -0700
                                                                                                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-28 22:48 +0000
                                                                                                        Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-28 16:53 -0700
                                                                                                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-29 00:32 +0000
                                                                                                            Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-28 18:50 -0700
                                                                                                              Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-29 16:24 +0000
                                                                                                            Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-29 13:37 +0100
                                                                                                              Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-29 16:33 +0000
                                                                                                                Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-29 17:23 +0000
                                                                                                                  Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-29 18:11 +0000
                                                                                              Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-28 10:57 -0700
                                                                            Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-25 16:16 +0000
                                                                        Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-25 13:29 +0200
                                                                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 14:58 +0000
                                                                            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-25 17:14 +0200
                                                                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 16:37 +0000
                                                                                Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-25 19:00 +0200
                                                                  Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-24 17:15 +0000
                                                                    Code-change-to-run times (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-24 18:44 +0100
                                                                      Re: Code-change-to-run times (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-24 23:06 +0200
                                                                        Re: Code-change-to-run times (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-24 23:44 +0100
                                                                          Re: Code-change-to-run times (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-25 13:00 +0200
                                                                Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-24 21:16 +0000
                                                                  Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-25 08:41 +0000
                                                                    Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 11:04 +0000
                                                                      Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-25 14:43 +0000
                                                                  Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-25 13:51 +0000
                                                                    Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 14:22 +0000
                                                          Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-24 17:10 +0200
                                                            Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-24 19:07 +0100
                                                          Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-24 15:44 +0000
                                                            Re: Suggested method for returning a string from a C program? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-24 11:27 -0700
                                                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-24 20:13 +0000
                                                            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-24 23:01 +0200
                                                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 11:17 +0000
                                                        Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-24 15:42 +0000
                                                          Re: Suggested method for returning a string from a C program? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-24 11:27 -0700
                                                    Compiler speed (ad nauseam) (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-24 18:01 +0100
                                                    Re: Suggested method for returning a string from a C program? James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-24 19:25 -0400
                                                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-25 00:53 +0000
                                                        Re: Suggested method for returning a string from a C program? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-03-24 19:00 -0700
                                                        Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-24 21:50 -0700
                                                        Re: Suggested method for returning a string from a C program? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-25 08:19 +0100
                                              Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-22 14:41 +0100
                                              Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-23 11:41 +0200
                                                Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-23 14:13 -0700
                                                  Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-23 23:19 +0200
                                        Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-22 07:05 -0700
                                Re: Suggested method for returning a string from a C program? antispam@fricas.org (Waldek Hebisch) - 2025-03-22 02:37 +0000
                                  Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 12:20 +0000
                                    Re: Suggested method for returning a string from a C program? antispam@fricas.org (Waldek Hebisch) - 2025-03-22 13:50 +0000
                                      Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 15:47 +0000
                              Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 17:00 +0000
                                Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-22 15:31 -0700
                        Re: Suggested method for returning a string from a C program? antispam@fricas.org (Waldek Hebisch) - 2025-03-21 17:51 +0000
                          Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-21 18:51 +0000
                            Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 02:16 +0000
                              Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-22 04:15 +0000
                                Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-21 21:24 -0700
                                Re: Suggested method for returning a string from a C program? antispam@fricas.org (Waldek Hebisch) - 2025-03-22 14:07 +0000
                                  Fast division (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 02:04 +0100
                                    Re: Fast division (was Re: Suggested method for returning a string from a C program?) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-03-25 22:35 -0400
                                      Re: Fast division (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 12:40 +0100
                                        Re: Fast division (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 14:47 +0100
                                          Re: Fast division (was Re: Suggested method for returning a string from a C program?) David Brown <david.brown@hesbynett.no> - 2025-03-26 17:55 +0100
                                        Re: Fast division (was Re: Suggested method for returning a string from a C program?) Michael S <already5chosen@yahoo.com> - 2025-03-26 19:36 +0200
                                      Re: Fast division (was Re: Suggested method for returning a string from a C program?) antispam@fricas.org (Waldek Hebisch) - 2025-03-26 13:44 +0000
                                        Re: Fast division (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 16:19 +0100
                                    Re: Fast division (was Re: Suggested method for returning a string from a C program?) antispam@fricas.org (Waldek Hebisch) - 2025-03-26 02:37 +0000
                                      Re: Fast division (was Re: Suggested method for returning a string from a C program?) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-03-26 14:42 +0100
                                    Re: Fast division (was Re: Suggested method for returning a string from a C program?) Rosario19 <Ros@invalid.invalid> - 2025-03-26 19:01 +0100
                                    Re: Fast division (was Re: Suggested method for returning a string from a C program?) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-26 18:49 +0000
                          Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 00:01 +0000
                            Re: Suggested method for returning a string from a C program? antispam@fricas.org (Waldek Hebisch) - 2025-03-22 01:41 +0000
                              Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-22 14:22 +0000
                                Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-22 14:32 +0000
                                Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-22 16:25 +0000
                      Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-20 16:35 +0200
                      Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 14:42 +0000
                      Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-20 16:20 +0000
                    Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 11:33 -0700
                    Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 12:07 -0700
          Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-19 12:59 -0700
            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-19 22:12 +0200
              Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 05:19 -0700
    Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-18 20:26 -0700
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 00:42 -0400
        Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 04:51 +0000
          Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 01:02 -0400
            Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 05:23 +0000
              Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 06:06 -0700
                Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-20 13:27 +0000
                  Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-20 16:50 +0200
                  Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 11:24 -0700
                    Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-20 18:53 +0000
                      Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 16:56 -0700
                    Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-22 16:46 -0700
                      Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-23 08:25 +0000
                        Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-23 12:06 +0200
                          Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-23 10:15 +0000
                        Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-23 12:35 -0700
                          Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-24 13:09 +0100
        Re: Suggested method for returning a string from a C program? Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2025-03-22 19:07 +1100
          Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-22 13:25 +0000
            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-22 19:12 +0200
            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-22 19:17 +0200
              Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-22 17:22 +0000
          Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-22 10:29 -0400
            Re: Suggested method for returning a string from a C program? Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2025-03-25 21:41 +1100
          Re: Suggested method for returning a string from a C program? scott@slp53.sl.home (Scott Lurndal) - 2025-03-22 14:30 +0000
            Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-22 11:31 -0400
            Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-22 19:19 +0200
          Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-22 14:54 -0700
    Re: Suggested method for returning a string from a C program? Ike Naar <ike@sdf.org> - 2025-03-19 07:16 +0000
      Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-19 01:53 -0700
        Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 16:45 -0400
          Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 21:21 +0000
            Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-19 21:35 +0000
          Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-19 14:56 -0700
            Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 22:34 -0400
              Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-19 19:46 -0700
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 11:25 -0400
    Re: Suggested method for returning a string from a C program? bart <bc@freeuk.com> - 2025-03-19 10:15 +0000
      Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-19 12:40 +0200
        Re: Suggested method for returning a string from a C program? David Brown <david.brown@hesbynett.no> - 2025-03-19 17:42 +0100
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 09:03 -0400
        Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-19 14:40 +0000
          Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-19 17:39 +0200
            Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-19 15:42 +0000
              Re: Suggested method for returning a string from a C program? Alexis <flexibeast@gmail.com> - 2025-03-22 15:05 +1100
                Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-22 10:19 +0000
                  Re: Suggested method for returning a string from a C program? Alexis <flexibeast@gmail.com> - 2025-03-23 11:05 +1100
                    Re: Suggested method for returning a string from a C program? Muttley@dastardlyhq.com - 2025-03-23 16:22 +0000
          Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-19 13:13 -0700
            Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 09:50 +0000
              Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 04:59 -0700
              Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-20 16:14 +0000
                Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-20 16:29 +0000
                  Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-20 16:49 +0000
                    Re: Suggested method for returning a string from a C program? Muttley@DastardlyHQ.org - 2025-03-21 09:09 +0000
                      Re: Suggested method for returning a string from a C program? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-03-21 17:12 +0000
    Re: Suggested method for returning a string from a C program? Michael S <already5chosen@yahoo.com> - 2025-03-19 12:36 +0200
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-19 09:13 -0400
      Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-20 05:15 -0700
        Re: Suggested method for returning a string from a C program? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-03-20 12:14 -0700
          Re: Suggested method for returning a string from a C program? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-03-21 00:05 -0700
            Re: Suggested method for returning a string from a C program? Richard Heathfield <rjh@cpax.org.uk> - 2025-03-21 07:48 +0000
    Re: Suggested method for returning a string from a C program? Lynn McGuire <lynnmcguire5@gmail.com> - 2025-03-22 13:32 -0500
      Re: Suggested method for returning a string from a C program? DFS <nospam@dfs.com> - 2025-03-23 12:29 -0400

Page 18 of 22 — ← Prev page 1 … 16 17 [18] 19 20 … 22  Next page →


#391683 — Re: Fast division (was Re: Suggested method for returning a string from a C program?)

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2025-03-26 16:19 +0100
SubjectRe: Fast division (was Re: Suggested method for returning a string from a C program?)
Message-ID<vs15tq$21fdg$1@dont-email.me>
In reply to#391671
On 26.03.2025 14:44, Waldek Hebisch wrote:
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>> On 3/25/25 21:04, Janis Papanagnou wrote:
>>> On 22.03.2025 15:07, Waldek Hebisch wrote:
>>>>
>>>> Actually, to do fast division of N-bit number by fixed N-bit number
>>>> one need 2N-bit multiplication. 
>>>
>>> I just stumbled across your post and above sentence. Do you mean *one*
>>> multiplication of 2N bit numbers?
>> I think he meant "one needs 2N-bit multiplication". "one" is a pronoun
>> in this context, not a number.
> 
> Yes, of course "one" in my text above is a pronoun.  I do not know
> how Janis guessed one multiplication, but it is correct guess.

The "one" was clear ("one need", "you need", "we need", etc.).

What was unclear was whether there's indeed only one multiplication
necessary. The "2N-bit multiplication" would also have been clear
from its writing; meaning "[one] multiplication of 2N bit entities".

But I couldn't imagine that a _general_ [non-const] division a/b
could be done with only one multiplication. That's were I speculated
whether you may have meant, say, "two N-bit multiplications" or some
such. - That's why I was asking for confirmation. - Later I saw that
you meant just a special case division a/c (with a _constant_ c),
which of course can be pre-computed.

Janis

> [...]

[toc] | [prev] | [next] | [standalone]


#391650 — Re: Fast division (was Re: Suggested method for returning a string from a C program?)

Fromantispam@fricas.org (Waldek Hebisch)
Date2025-03-26 02:37 +0000
SubjectRe: Fast division (was Re: Suggested method for returning a string from a C program?)
Message-ID<vrvp94$3q1ah$1@paganini.bofh.team>
In reply to#391648
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> On 22.03.2025 15:07, Waldek Hebisch wrote:
>> 
>> Actually, to do fast division of N-bit number by fixed N-bit number
>> one need 2N-bit multiplication. 
> 
> I just stumbled across your post and above sentence. Do you mean *one*
> multiplication of 2N bit numbers? - Could you please explain that (by
> an example, or could you provide a reference)?

One multiplications with 2N bit result + few other operations
like shifts and additions.  Consider for example:

unsigned int
divv(unsigned int a) {
    return a/1234567;
}

My gcc-12 at -O generates the following assembly code:

divv:
.LFB0:
        .cfi_startproc
        movl    %edi, %eax
        movl    $3000869427, %edx
        imulq   %rdx, %rax
        shrq    $32, %rax
        subl    %eax, %edi
        shrl    %edi
        addl    %edi, %eax
        shrl    $20, %eax
        ret

So 1 multiplication, 3 shifts, subtraction and addtion.  When
more bits of multiplication are available one can use smaller
number of extra operations.  For example, when I change
function above so that argument is 16-bit and divisor is
12345, the code is:

divv:
.LFB0:
        .cfi_startproc
        movzwl  %di, %eax
        imull   $43489, %eax, %eax
        shrl    $29, %eax
        ret

So just 1 multiplication and 1 shift.

The idea beside this is quite simple: instead of division we
multiply by reciprocal.  Reciprocal is represented in fixed
point aritihemtic (so normally there is at least one shift to get
binary point in right place).  Since divisor is fixed reciprocal can
be precomputed.  This works best when there is enough accuracy,
otherwise one needs to add extra steps.  Working out how
many bits of accuracy are needed is a bit tricky, in particular
by adding extra operations one can lower needed accuracy.

> (The reason for my question is that for integer divisions of length N
> an old DSP I used required besides shifts effectively N subtractions
> to create the result and modulus; it didn't use any multiplications.)

Method above is good when you have fast and wide multiplier (compared
to your numbers).  Also there is cost of precomputation,
to gain divisor must be fixed or at least change slowly.
If you have varying divisor then one can use Newton method
(IIUC this is what modern CPU-s use).  Shifts and subtractions
are good when you do not have fast multiplier.

-- 
                              Waldek Hebisch

[toc] | [prev] | [next] | [standalone]


#391670 — Re: Fast division (was Re: Suggested method for returning a string from a C program?)

FromJanis Papanagnou <janis_papanagnou+ng@hotmail.com>
Date2025-03-26 14:42 +0100
SubjectRe: Fast division (was Re: Suggested method for returning a string from a C program?)
Message-ID<vs108m$1scgt$1@dont-email.me>
In reply to#391650
On 26.03.2025 03:37, Waldek Hebisch wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>> On 22.03.2025 15:07, Waldek Hebisch wrote:
>>>
>>> Actually, to do fast division of N-bit number by fixed N-bit number
>>> one need 2N-bit multiplication. 
>>
>> I just stumbled across your post and above sentence. Do you mean *one*
>> multiplication of 2N bit numbers? - Could you please explain that (by
>> an example, or could you provide a reference)?
> 
> One multiplications with 2N bit result + few other operations
> like shifts and additions.  Consider for example:
> 
> unsigned int
> divv(unsigned int a) {
>     return a/1234567;
> }

Ah, I suppose you meant that (in case of constant divisors) the
compiler would just _pre-compute_ the reciprocal value (and can
then just multiply, of course). - Is that understanding correct?

Given that I don't know the semantics of the assembler below I'm
just speculating, but - given you used a constant "1234567" - it
seems the compiler used a different value ("3000869427") for the
multiplication, the reciprocal - right?

> 
> My gcc-12 at -O generates the following assembly code:
> 
> divv:
> .LFB0:
>         .cfi_startproc
>         movl    %edi, %eax
>         movl    $3000869427, %edx
>         imulq   %rdx, %rax
>         shrq    $32, %rax
>         subl    %eax, %edi
>         shrl    %edi
>         addl    %edi, %eax
>         shrl    $20, %eax
>         ret
> 
> So 1 multiplication, 3 shifts, subtraction and addtion.  When
> more bits of multiplication are available one can use smaller
> number of extra operations.  For example, when I change
> function above so that argument is 16-bit and divisor is
> 12345, the code is:
> 
> divv:
> .LFB0:
>         .cfi_startproc
>         movzwl  %di, %eax
>         imull   $43489, %eax, %eax
>         shrl    $29, %eax
>         ret
> 
> So just 1 multiplication and 1 shift.
> 
> The idea beside this is quite simple: instead of division we
> multiply by reciprocal. 

First I thought that your formulation implies that there's a trick
where _any_ division  a/b  could be expressed by a multiplication
(and some primitive binary operations). - Which would have been cool.

> Reciprocal is represented in fixed
> point aritihemtic (so normally there is at least one shift to get
> binary point in right place).  Since divisor is fixed reciprocal can
> be precomputed.  This works best when there is enough accuracy,
> otherwise one needs to add extra steps.  Working out how
> many bits of accuracy are needed is a bit tricky, in particular
> by adding extra operations one can lower needed accuracy.
> 
>> (The reason for my question is that for integer divisions of length N
>> an old DSP I used required besides shifts effectively N subtractions
>> to create the result and modulus; it didn't use any multiplications.)
> 
> Method above is good when you have fast and wide multiplier (compared
> to your numbers).  Also there is cost of precomputation,
> to gain divisor must be fixed or at least change slowly.
> If you have varying divisor then one can use Newton method
> (IIUC this is what modern CPU-s use).  Shifts and subtractions
> are good when you do not have fast multiplier.

Actually the (meanwhile very old) DSP I used (in the mid 1980's) had
a fast multiplier; + and - were done in one cycle, * (asymptotically)
also one cycle. The interesting part was that the [general] non-const
division was "constructed" (as opposed to pre-existing as an opcode).
All operations (roughly) required just one cycle but the division; it
was constructed by a 'repeat' opcode for the next opcode. So if you
had written something like  LACC addr1 ; RPTK 16 ; SUBC addr2  that
would have divided the data  *addr1 / *addr2  (informally written)
providing both results, the division and the modulus.

Out of interest I've implemented the logic in "C" to demonstrate it
(the variable names reflect the DSP terminology and the sizes of the
data words (16) and accumulator (32), only the '<< 15' is originally
part of the 'subc' opcode/"C" function (but shifts did not cost any
extra cycles, they've been done in passing, sort of):

    void subc (int32_t * acc, int32_t * dma)
    {
        int32_t acc_out;
        if ((acc_out = *acc - *dma) >= 0)
            *acc = acc_out << 1 | 1;
        else
            *acc <<= 1;
    }
...
    int16_t z = 47;
    int16_t n = 6;
    // calculate "z div n" and "z mod n"
    int32_t acc = z;
    int32_t dma = n << 15;

    for (int i=1; i<=16; i++)
        subc (&acc, &dma);

    printf ("%d div %d = %d\n", z, n, acc&0xffff);
    printf ("%d mod %d = %d\n", z, n, acc>>16);

I considered that DSP feature quite interesting. That was from a time
where the usual processors required something like 4 cycles for + and
-, around 16 cycles for *, and 80 cycles for the division. (Numbers
are just faint memories from an 68k CPU, so correct me if I'm wrong.)

Janis

[toc] | [prev] | [next] | [standalone]


#391697 — Re: Fast division (was Re: Suggested method for returning a string from a C program?)

FromRosario19 <Ros@invalid.invalid>
Date2025-03-26 19:01 +0100
SubjectRe: Fast division (was Re: Suggested method for returning a string from a C program?)
Message-ID<c3g8ujtv9lqqlf5d3go718ao0sh6d8ujfq@4ax.com>
In reply to#391648
On Wed, 26 Mar 2025 02:04:40 +0100, Janis Papanagnou wrote:

>On 22.03.2025 15:07, Waldek Hebisch wrote:
>> 
>> Actually, to do fast division of N-bit number by fixed N-bit number
>> one need 2N-bit multiplication. 

pheraps that means a/b where a is in a big set, is more heavy to
calculate that a* 1/b where a is in a big set of numbers

>I just stumbled across your post and above sentence. Do you mean *one*
>multiplication of 2N bit numbers? - Could you please explain that (by
>an example, or could you provide a reference)?
>
>(The reason for my question is that for integer divisions of length N
>an old DSP I used required besides shifts effectively N subtractions
>to create the result and modulus; it didn't use any multiplications.)
>
>Janis

[toc] | [prev] | [next] | [standalone]


#391704 — Re: Fast division (was Re: Suggested method for returning a string from a C program?)

FromKaz Kylheku <643-408-1753@kylheku.com>
Date2025-03-26 18:49 +0000
SubjectRe: Fast division (was Re: Suggested method for returning a string from a C program?)
Message-ID<20250326113353.769@kylheku.com>
In reply to#391648
On 2025-03-26, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> On 22.03.2025 15:07, Waldek Hebisch wrote:
>> 
>> Actually, to do fast division of N-bit number by fixed N-bit number
>> one need 2N-bit multiplication. 
>
> I just stumbled across your post and above sentence. Do you mean *one*
> multiplication of 2N bit numbers? - Could you please explain that (by
> an example, or could you provide a reference)?

When an integer divisor is a constant expression like 17,
we can calculate the division x/17 using multiplication itself.

It's easier to ask AI than to work this out from scratch.

The AI I choose for this task is GCC:

Given the prompt:

  unsigned div17(unsigned x)
  {
    return x/17;
  }

The GCC language model version 14 generates this Motorola 68K assembly:

div17:
        move.l 4(%sp),%d0
        mulu.l #4042322161,%d1:%d0
        move.l %d1,%d0
        lsr.l #4,%d0
        rts

The argument value is on the stack at 4(%sp), and gets loaded into
d0. This undergoes a 64 bit multiplication into the pair of registers
d1:d0.

This is then effectively shifted right by 36 bits to truncate it
to integer. This is because the result is a rational integer
represented in fixed point, where the low 36 bits are fractional.

What is the magic constant 4042322161?  It's this, rounded off:

  1> (/ (expt 2 36) 17)
  4042322160.94118

Basically 1/17 scaled by 2^36. Why 36 is that the result fits into 32 bits; we
don't need to represent the initial zeros past the binary point.

So if we multiply by this representation of 1/17 and then remove
the scale, we get a result divided by 17.

Obviously, this is not practical for a non-constant divisor, because
it takes more calculation to obtain the multiplication coefficient
than to just use the division instruction.

P.S. I used unsigned because the int version resulted in more
complicated code, with details that distract from the basic idea.

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

[toc] | [prev] | [next] | [standalone]


#391484

Frombart <bc@freeuk.com>
Date2025-03-22 00:01 +0000
Message-ID<vrkulk$2k04q$1@dont-email.me>
In reply to#391477
On 21/03/2025 17:51, Waldek Hebisch wrote:
> bart <bc@freeuk.com> wrote:

>> As defined by Unix/Linux, long is not portable between different
>> Unix/Linux OSes if they run on a different architecture.
> 
> It portably between 32 and 64 bit machines gives word-sized
> integer type.

Which was not its intention. (Probably intptr_t or ssize_t is better for 
that purpose, and will be portable between Windows and Linux.)


>> As defined by Microsoft, long is portable between Windows OSes even on
>> different architectures.
> 
> It gives 'long' different meaning than it had previously.


I explained the differences without necessarily saying one is better 
than the other. Sometimes one is more more useful, sometimes the other.


> And to
> that matters rather useless meaning, as already 'int' gives 32
> bit integers on bigger machines.

Well, 'long' is also useless on 32-bit Linux machines as it is the same 
size as 'int'. Why didn't it also increase when 'int' migrated from i16 
to i32?

One 'con' for Linux' approach is when someone assumes 'long' is i32; 
when they run code on 64 bits, it will either be wasteful, or it could 
go badly wrong.

While those running on Linux64 and expect 'long' to be double the width 
of 'int', may also experience failures on Linux32.

On Windows, you just learn to avoid 'long' completely. After all you 
don't need 5 basic types for four integer sizes!


> 
>>    'long long' is defined as a 64-bit
>>> type in both Windows and Linux.
>>>
>>> Using the defined width types is far better (e.g. uint64_t);
>>> even if the standard allows the type to not exist on a particular
>>> implementation.  No useful implementation would fail to define
>>> uint64_t in these modern times.
>>
> <snip>
>> The problem with 'long' manifests itself there too, since on Linux,
>> 'int64_t' appears to be commonly defined on top of 'long' for 32-bit
>> systems, and 'long long' for 64-bit ones.
> 
> You mixed up this: 'int64_t' is defined as 'long long' for 32-bit
> systems and as 'long' for 64-bit ones.

Sorry, yes. But it shows how confusing it all is:

LL/ll is used for 64 bits on 32-bit systems
L/l   is used for 32 bits on 64-bit systems!

(I'm so glad I switched to all-64-bits in my own stuff, early last decade.

However lots of software has taken a long time to catch up. I acquired 
an RPi 4 board 5 years ago with a view to doing 64-bit ARM development, 
but most OSes were still 32 bits, and 64-bit ones immature. (You need a 
64-bit OS to easily develop and run 64-bit programs.)

Even now, 32-bit OSes are supplied by default. I finally got a solid 
64-bit OS for it last week. I just wondered what the point is of having 
64-bit hardware if people just run 32-bit stuff on it.)


>  Doing it as you wrote
> would give you variable length type.  Of course, if you need
> word-sized integer in Windows you may define it as 'long' for 32-bit
> Windows and as 'long long' for 64-bit ones.
> 

(I'll tell you a secret: my C compiler automatically reads a special 
header that includes these definitions:

   typedef signed char     i8;
   typedef short           i16;
   typedef int             i32;
   typedef long long int   i64;

   typedef unsigned char           u8;
   typedef unsigned char           byte;
   typedef unsigned short          u16;
   typedef unsigned int            u32;
   typedef unsigned long long int  u64;

   typedef float           r32;
   typedef double          r64;

It makes the writing of hundreds of small test programs so much easier. 
I wonder how many do the same, although they'd have to use a discrete 
header.)

[toc] | [prev] | [next] | [standalone]


#391486

Fromantispam@fricas.org (Waldek Hebisch)
Date2025-03-22 01:41 +0000
Message-ID<vrl4g4$2lf61$1@paganini.bofh.team>
In reply to#391484
bart <bc@freeuk.com> wrote:
> On 21/03/2025 17:51, Waldek Hebisch wrote:
>> bart <bc@freeuk.com> wrote:
> 
>>> As defined by Unix/Linux, long is not portable between different
>>> Unix/Linux OSes if they run on a different architecture.
>> 
>> It portably between 32 and 64 bit machines gives word-sized
>> integer type.
> 
> Which was not its intention.

This was intention when 64-bit machines appeared.

> (Probably intptr_t or ssize_t is better for 
> that purpose, and will be portable between Windows and Linux.)

Those did not exist in 1991 and would be needed only for small
machines.  Except for Microsoft which decided to push its own,
different way.
 
>>> As defined by Microsoft, long is portable between Windows OSes even on
>>> different architectures.
>> 
>> It gives 'long' different meaning than it had previously.
> 
> 
> I explained the differences without necessarily saying one is better 
> than the other. Sometimes one is more more useful, sometimes the other.

AFAICS your main trouble with 'long' is inconsistency.  And the
inconsistency is due to Microsoft, as previously 'long' had
consitent definition on resonable machines: integer with max of
32 bits and word size, which simplified to word size on
"bigger" machines.

>> And to
>> that matters rather useless meaning, as already 'int' gives 32
>> bit integers on bigger machines.
> 
> Well, 'long' is also useless on 32-bit Linux machines as it is the same 
> size as 'int'.

Not always.  Motorola 68000 used 16-bit int.  That was because
original 68000 had 16-bit bus which made 16-bit integers faster.

> One 'con' for Linux' approach is when someone assumes 'long' is i32; 
> when they run code on 64 bits, it will either be wasteful, or it could 
> go badly wrong.

One 'con' of any assumption is that somebody can make a different
assumption.

> (I'm so glad I switched to all-64-bits in my own stuff, early last decade.
> 
> However lots of software has taken a long time to catch up. I acquired 
> an RPi 4 board 5 years ago with a view to doing 64-bit ARM development, 
> but most OSes were still 32 bits, and 64-bit ones immature. (You need a 
> 64-bit OS to easily develop and run 64-bit programs.)

I am not sure what was available for RPi 4.  But in 2019 I got 64-bit
chinese ARM board and it was well supported by 64-bit Linux (armbian).
Apparently Raspberry Pi foundation wanted to have the same OS on all
their boards (not only newest ones) so they delivered 32-bit OS for
some time after 64-bit board appeared.  IIUC normal Linux distributions
rather quickly got 64-bit ARM versions.

> Even now, 32-bit OSes are supplied by default. I finally got a solid 
> 64-bit OS for it last week. I just wondered what the point is of having 
> 64-bit hardware if people just run 32-bit stuff on it.)

See above.

-- 
                              Waldek Hebisch

[toc] | [prev] | [next] | [standalone]


#391505

Fromscott@slp53.sl.home (Scott Lurndal)
Date2025-03-22 14:22 +0000
Message-ID<2JzDP.1208306$_N6e.1205396@fx17.iad>
In reply to#391486
antispam@fricas.org (Waldek Hebisch) writes:
>bart <bc@freeuk.com> wrote:
>> On 21/03/2025 17:51, Waldek Hebisch wrote:
>>> bart <bc@freeuk.com> wrote:

>> (Probably intptr_t or ssize_t is better for 
>> that purpose, and will be portable between Windows and Linux.)
>
>Those did not exist in 1991 and would be needed only for small
>machines.  Except for Microsoft which decided to push its own,
>different way.

ssize_t existed in before 1990 (in SVR4).   intptr_t came later.

$ grep ssize_t common/head/*
common/head/aio.h:  ssize_t            aio__return;    /* operation result value       */
common/head/unistd.h:extern ssize_t    read(int, void *, size_t);
common/head/unistd.h:extern ssize_t    write(int, const void *, size_t);


>> One 'con' for Linux' approach is when someone assumes 'long' is i32; 
>> when they run code on 64 bits, it will either be wasteful, or it could 
>> go badly wrong.
>
>One 'con' of any assumption is that somebody can make a different
>assumption.

Programmers shouldn't be making 'assumptions' in the first place.

The architectural ABI describes fully the capabilities of the
native types.  If the programmer isn't aware of that, they
shouldn't be programming.

[toc] | [prev] | [next] | [standalone]


#391508

FromRichard Heathfield <rjh@cpax.org.uk>
Date2025-03-22 14:32 +0000
Message-ID<vrmhl1$3ipe$2@dont-email.me>
In reply to#391505
On 22/03/2025 14:22, Scott Lurndal wrote:
> Programmers shouldn't be making 'assumptions' in the first place.
> 
> The architectural ABI describes fully the capabilities of the
> native types.  If the programmer isn't aware of that, they
> shouldn't be programming.

Did programmer just assume that all programmers are told on which 
platforms their code will be run? Not all C programmers are so 
pampered.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#391514

Frombart <bc@freeuk.com>
Date2025-03-22 16:25 +0000
Message-ID<vrmo9s$933o$2@dont-email.me>
In reply to#391505
On 22/03/2025 14:22, Scott Lurndal wrote:
> antispam@fricas.org (Waldek Hebisch) writes:
>> bart <bc@freeuk.com> wrote:
>>> On 21/03/2025 17:51, Waldek Hebisch wrote:
>>>> bart <bc@freeuk.com> wrote:
> 
>>> (Probably intptr_t or ssize_t is better for
>>> that purpose, and will be portable between Windows and Linux.)
>>
>> Those did not exist in 1991 and would be needed only for small
>> machines.  Except for Microsoft which decided to push its own,
>> different way.
> 
> ssize_t existed in before 1990 (in SVR4).   intptr_t came later.
> 
> $ grep ssize_t common/head/*
> common/head/aio.h:  ssize_t            aio__return;    /* operation result value       */
> common/head/unistd.h:extern ssize_t    read(int, void *, size_t);
> common/head/unistd.h:extern ssize_t    write(int, const void *, size_t);
> 
> 
>>> One 'con' for Linux' approach is when someone assumes 'long' is i32;
>>> when they run code on 64 bits, it will either be wasteful, or it could
>>> go badly wrong.
>>
>> One 'con' of any assumption is that somebody can make a different
>> assumption.
> 
> Programmers shouldn't be making 'assumptions' in the first place.
> 
> The architectural ABI describes fully the capabilities of the
> native types.  If the programmer isn't aware of that, they
> shouldn't be programming.
> 

This is 'making assumptions' when the code is subsequently run on a 
different platform.

And those assumptions made by a million programmers in myriad codebases 
are behind decisions on whether to increase 'int' and/or 'long' when 
implementing the language on a new architecture with wider types.

[toc] | [prev] | [next] | [standalone]


#391403

FromMichael S <already5chosen@yahoo.com>
Date2025-03-20 16:35 +0200
Message-ID<20250320163537.000018f1@yahoo.com>
In reply to#391400
On Thu, 20 Mar 2025 13:36:43 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:

> bart <bc@freeuk.com> writes:
> >On 20/03/2025 12:09, Tim Rentsch wrote:  
> >> Michael S <already5chosen@yahoo.com> writes:  
> >  
> >>> I suspected that, but was not sure, so suggested to DFS a type
> >>> that I am sure about.  
> >> 
> >> The width of  char and [un]signed char   must be at least  8 bits.
> >> The width of          [un]signed short   must be at least 16 bits.
> >> The width of            [un]signed int   must be at least 16 bits.
> >> The width of           [un]signed long   must be at least 32 bits.
> >> The width of      [un]signed long long   must be at least 64 bits.
> >> 
> >> That should be easy enough to remember now.  
> >
> >That table suggests that any program mixing 'short' and 'int' is 
> >suspect. If 'int' doesn't need to store values beyond 16 bits, then
> >why not use 'short'?
> >
> >'long' is another troublesome one. If the need is for 32-bit values, 
> >then it's surprisingly rare in source code.  
> 
> Long is useless, because Microsoft made the mistake of defining
> 'long' as 32-bits on 64-bit architectures, while unix and linux
> define it as 64-bits.
> 
> So long can't be used in programs intended to be portable to
> other operating systems.  'long long' is defined as a 64-bit
> type in both Windows and Linux.
> 
> Using the defined width types is far better (e.g. uint64_t);
> even if the standard allows the type to not exist on a particular
> implementation.  No useful implementation would fail to define
> uint64_t in these modern times.
> 

Unfortunately, gcc people made a mess out of it as well, defining (on
64-bit Linux platforms) int64_t/uint64_t as aliases to respective 'long'
types instead of aliasing them to 'long long', to be the same on all
platforms that matter. 
I'd guess they were afraid of being accused of being sensible.



[toc] | [prev] | [next] | [standalone]


#391404

FromMuttley@DastardlyHQ.org
Date2025-03-20 14:42 +0000
Message-ID<vrh9fu$3eg1e$1@dont-email.me>
In reply to#391400
On Thu, 20 Mar 2025 13:36:43 GMT
scott@slp53.sl.home (Scott Lurndal) wibbled:
>bart <bc@freeuk.com> writes:
>>On 20/03/2025 12:09, Tim Rentsch wrote:
>>> Michael S <already5chosen@yahoo.com> writes:
>>
>>>> I suspected that, but was not sure, so suggested to DFS a type that I am
>>>> sure about.
>>> 
>>> The width of  char and [un]signed char   must be at least  8 bits.
>>> The width of          [un]signed short   must be at least 16 bits.
>>> The width of            [un]signed int   must be at least 16 bits.
>>> The width of           [un]signed long   must be at least 32 bits.
>>> The width of      [un]signed long long   must be at least 64 bits.
>>> 
>>> That should be easy enough to remember now.
>>
>>That table suggests that any program mixing 'short' and 'int' is 
>>suspect. If 'int' doesn't need to store values beyond 16 bits, then why 
>>not use 'short'?
>>
>>'long' is another troublesome one. If the need is for 32-bit values, 
>>then it's surprisingly rare in source code.
>
>Long is useless, because Microsoft made the mistake of defining
>'long' as 32-bits on 64-bit architectures, while unix and linux

Probably for backwards compatibility with 32 bit code that did bit twiddling 
with longs.

[toc] | [prev] | [next] | [standalone]


#391420

FromKaz Kylheku <643-408-1753@kylheku.com>
Date2025-03-20 16:20 +0000
Message-ID<20250320091624.937@kylheku.com>
In reply to#391400
On 2025-03-20, Scott Lurndal <scott@slp53.sl.home> wrote:
> Long is useless, because Microsoft made the mistake of defining
> 'long' as 32-bits on 64-bit architectures, while unix and linux
> define it as 64-bits.

long was once useful for avoiding the predicament int is as few as
16 bits wide on some systems.

This is an almost entirely obsolete concern.

In code that assumes int >= 32 bits, but is otherwise intended
to be portable, long serves no purpose.

In comp.lang.c, we use long for anything that needs to go
beyond 32767, but not beyond 2147483647. :)

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

[toc] | [prev] | [next] | [standalone]


#391427

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2025-03-20 11:33 -0700
Message-ID<865xk3o8l6.fsf@linuxsc.com>
In reply to#391397
bart <bc@freeuk.com> writes:

> On 20/03/2025 12:09, Tim Rentsch wrote:
>
>> Michael S <already5chosen@yahoo.com> writes:
>>
>>> I suspected that, but was not sure, so suggested to DFS a type that I am
>>> sure about.
>>
>> The width of  char and [un]signed char   must be at least  8 bits.
>> The width of          [un]signed short   must be at least 16 bits.
>> The width of            [un]signed int   must be at least 16 bits.
>> The width of           [un]signed long   must be at least 32 bits.
>> The width of      [un]signed long long   must be at least 64 bits.
>>
>> That should be easy enough to remember now.
>
> That table suggests that any program mixing 'short' and 'int' is
> suspect.

To me it does not.  The table lists minimum values for all
implementations, and not the most common values for typical
implementations.

> If 'int' doesn't need to store values beyond 16 bits, then
> why not use 'short'?

I expect any developer who has spent even a fairly short time
learning C and writing C code knows the answer to this question,
and does not need to consult the table shown above to make an
appropriate choice between 'int' and 'short' in each of the
circumstances where the question may occur.

[toc] | [prev] | [next] | [standalone]


#391432

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2025-03-20 12:07 -0700
Message-ID<878qozttb8.fsf@nosuchdomain.example.com>
In reply to#391397
bart <bc@freeuk.com> writes:
> On 20/03/2025 12:09, Tim Rentsch wrote:
>> Michael S <already5chosen@yahoo.com> writes:
>
>>> I suspected that, but was not sure, so suggested to DFS a type that I am
>>> sure about.
>> The width of  char and [un]signed char   must be at least  8 bits.
>> The width of          [un]signed short   must be at least 16 bits.
>> The width of            [un]signed int   must be at least 16 bits.
>> The width of           [un]signed long   must be at least 32 bits.
>> The width of      [un]signed long long   must be at least 64 bits.
>> That should be easy enough to remember now.
>
> That table suggests that any program mixing 'short' and 'int' is
> suspect. If 'int' doesn't need to store values beyond 16 bits, then
> why not use 'short'?

POSIX requires int to be at least 32 bits wide.  I believe Win32
requires int to be exactly 32 bits wide.  If you're writing code that
already depends on either POSIX or Win32, it's reasonable to rely on
that assumption.

[...]

> My suggestion for writing code that is not going to run on 16-bit or
> lesser (or unusual) hardware is to assume:
>
>   char        8 bits
>   short      16 bits
>   int        32 bits
>   long long  64 bits
>
> and to forget 'long'.

Are those widths supposed to be exact?  You can assume those types are
*at least* that wide (if you're already relying on POSIX or Win32), but
I wouldn't assume the widths are exact unless the code was *only* ever
intended to be used with a specific model.  (I've used POSIX-based
systems with 64-bit short, for example.)

If I want exact-width types, I know where to find them.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#391371

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2025-03-19 12:59 -0700
Message-ID<86jz8kpzam.fsf@linuxsc.com>
In reply to#391339
Michael S <already5chosen@yahoo.com> writes:

> On Wed, 19 Mar 2025 00:38:44 -0400
> DFS <nospam@dfs.com> wrote:
>
>> On 3/18/2025 11:07 PM, Tim Rentsch wrote:
>>
>>
>>> Have you thought about how large the value of 'n' can
>>> become inside the while() loop?
>>
>> I was too smug in my first reply.  After Keith pointed out I needed
>> to read from stdin, I submitted the code again and it passed some
>> tests but failed with 'OUTPUT LIMIT EXCEEDED' when n = 159487.
>>
>> Updating int to long worked, and now I'm bona fide!
>>
>> So thanks.
>
> What you did happens to be sufficient for a particular environment
> (supposedly, x86-64 Linux) used both by yourself and by the server that
> tests results.
> In more general case, 'long' is not guaranteed to handle numbers in
> range up to 18,997,161,173 that can happen in this test.

The number 18997161173 is odd.  The largest value reached is three
times that, plus 1, which is 56991483520.

> Something like int64_t would be safer.

Using unsigned long long is safer still, and easier, because there
is no need for hoop-jumping to print them out with printx.

[toc] | [prev] | [next] | [standalone]


#391372

FromMichael S <already5chosen@yahoo.com>
Date2025-03-19 22:12 +0200
Message-ID<20250319221227.00001f8c@yahoo.com>
In reply to#391371
On Wed, 19 Mar 2025 12:59:13 -0700
Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:

> Michael S <already5chosen@yahoo.com> writes:
> 
> > On Wed, 19 Mar 2025 00:38:44 -0400
> > DFS <nospam@dfs.com> wrote:
> >  
> >> On 3/18/2025 11:07 PM, Tim Rentsch wrote:
> >>
> >>  
> >>> Have you thought about how large the value of 'n' can
> >>> become inside the while() loop?  
> >>
> >> I was too smug in my first reply.  After Keith pointed out I needed
> >> to read from stdin, I submitted the code again and it passed some
> >> tests but failed with 'OUTPUT LIMIT EXCEEDED' when n = 159487.
> >>
> >> Updating int to long worked, and now I'm bona fide!
> >>
> >> So thanks.  
> >
> > What you did happens to be sufficient for a particular environment
> > (supposedly, x86-64 Linux) used both by yourself and by the server
> > that tests results.
> > In more general case, 'long' is not guaranteed to handle numbers in
> > range up to 18,997,161,173 that can happen in this test.  
> 
> The number 18997161173 is odd.  The largest value reached is three
> times that, plus 1, which is 56991483520.
> 

Yes, my mistake. 
I only looked for maximal odd number in the sequence. Forgot about
even numbers.

> > Something like int64_t would be safer.  
> 
> Using unsigned long long is safer still, and easier, because there
> is no need for hoop-jumping to print them out with printx.

I explained the reason in the reply to Richard Heathfield.



[toc] | [prev] | [next] | [standalone]


#391396

FromTim Rentsch <tr.17687@z991.linuxsc.com>
Date2025-03-20 05:19 -0700
Message-ID<86iko3opxl.fsf@linuxsc.com>
In reply to#391372
Michael S <already5chosen@yahoo.com> writes:

> On Wed, 19 Mar 2025 12:59:13 -0700
> Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
>
>> Michael S <already5chosen@yahoo.com> writes:
>>
>>> On Wed, 19 Mar 2025 00:38:44 -0400
>>> DFS <nospam@dfs.com> wrote:
>>>
>>>> On 3/18/2025 11:07 PM, Tim Rentsch wrote:
>>>>
>>>>
>>>>> Have you thought about how large the value of 'n' can
>>>>> become inside the while() loop?
>>>>
>>>> I was too smug in my first reply.  After Keith pointed out I needed
>>>> to read from stdin, I submitted the code again and it passed some
>>>> tests but failed with 'OUTPUT LIMIT EXCEEDED' when n = 159487.
>>>>
>>>> Updating int to long worked, and now I'm bona fide!
>>>>
>>>> So thanks.
>>>
>>> What you did happens to be sufficient for a particular environment
>>> (supposedly, x86-64 Linux) used both by yourself and by the server
>>> that tests results.
>>> In more general case, 'long' is not guaranteed to handle numbers in
>>> range up to 18,997,161,173 that can happen in this test.
>>
>> The number 18997161173 is odd.  The largest value reached is three
>> times that, plus 1, which is 56991483520.
>
> Yes, my mistake.
> I only looked for maximal odd number in the sequence.  Forgot about
> even numbers.

Yes, I realized that, after the fact.

>>> Something like int64_t would be safer.
>>
>> Using unsigned long long is safer still, and easier, because there
>> is no need for hoop-jumping to print them out with printx.
>
> I explained the reason in the reply to Richard Heathfield.

Yes I saw that.  Part of my motivation for the comment is to
augment the knowledge of those who aren't sure.

[toc] | [prev] | [next] | [standalone]


#391325

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2025-03-18 20:26 -0700
Message-ID<87a59hvgyk.fsf@nosuchdomain.example.com>
In reply to#391319
DFS <nospam@dfs.com> writes:
> I'm doing these algorithm problems at
> https://cses.fi/problemset/list/
>
> For instance: Weird Algorithm
> https://cses.fi/problemset/task/1068
>
> My code works fine locally (prints the correct solution to the
> console), but when I submit the .c file the auto-tester flags it with
> 'runtime error' and says the output is empty.
>
> ------------------------------------------------------------
> // If n is even, divide it by two.
> // If n is odd, multiply it by three and add one.
> // Repeat until n is one.
> // n = 3: output is 3 10 5 16 8 4 2 1
>
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
>
> int main(int argc, char *argv[])
> {
>     int n = atoi(argv[1]);
[...]

There's your problem.

https://cses.fi/problemset/text/2433

"In all problems you should read input from standard input and write
output to standard output."

The autotester expects your program to read arguments from stdin, not
from command line arguments.

It probably passes no arguments to your program, so argv[1] is a null
pointer.  It's likely your program compiles (assuming the NBSP
characters were added during posting) and crashes at runtime, producing
no output.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#391329

FromDFS <nospam@dfs.com>
Date2025-03-19 00:42 -0400
Message-ID<vrdi0g$47cb$3@dont-email.me>
In reply to#391325
On 3/18/2025 11:26 PM, Keith Thompson wrote:
> DFS <nospam@dfs.com> writes:


> There's your problem.
> 
> https://cses.fi/problemset/text/2433
> 
> "In all problems you should read input from standard input and write
> output to standard output."

ha!  It usually helps to read the instructions first.


> The autotester expects your program to read arguments from stdin, not
> from command line arguments.
> 
> It probably passes no arguments to your program, so argv[1] is a null
> pointer.  It's likely your program compiles (assuming the NBSP
> characters were added during posting) and crashes at runtime, producing
> no output.


I KNEW clc would come through!

Pretty easy fixes:

1 use scanf()
2 update int to long
3 handle special case of n = 1
4 instead of collecting the results in a char variable, I print
   them as they're calculated

The algorithm part was very simple and correct.  Later ones won't be so 
easy.  I coded 4 so far (but just submitted this one here), and plan on 
doing all 300.

https://imgur.com/bq0pKIw

Did you hear a boom?

Thanks again!


updated code that passes:
===============================================================
// If n is even, divide it by two.
// If n is odd, multiply it by three and add one.
// Repeat until n is one.
// example: the sequence for n=3 is  3 10 5 16 8 4 2 1

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	long n = 0;
	scanf("%ld", &n);
	printf("%ld ",n);
	while(1) {	
		if(n==1) {exit(0);}
		
		if((n % 2) == 0)
			{n /= 2;}
		else
			{n = (n * 3) + 1;}
			
		if(n != 1)
			{printf("%ld ",n);}
		else
			break;
	}	
	printf("1\n");
	return 0;
}	
===============================================================

[toc] | [prev] | [next] | [standalone]


Page 18 of 22 — ← Prev page 1 … 16 17 [18] 19 20 … 22  Next page →

Back to top | Article view | comp.lang.c


csiph-web