• Re: relearning C: why does an in-place change to a char* segfault?

    From Tim Rentsch@[email protected] to comp.lang.c on Sun Mar 1 18:30:43 2026
    From Newsgroup: comp.lang.c

    Keith Thompson <[email protected]> writes:

    Tim Rentsch <[email protected]> writes:

    Keith Thompson <[email protected]> writes:

    The more C is changed to resemble C++ the worse it becomes. It
    isn't surprising that you like it.

    I presume that was intended as a personal insult.

    It wasn't.

    Then you need to work on knowing when you've insulted someone.

    I see no reason to feel an obligation to know whether someone
    might feel insulted by something I say. Feeling insulted is a
    subjective reaction, not an objective truth. If someone said
    to me "it isn't surprising that you dislike C++" I might agree
    (or not) with them, but I don't feel insulted by it; all they
    are doing is giving their subjective reaction to my behavior.

    On the contrary, it seems presumptuous of you to judge that it
    was my intention to insult you. In cases where I'm not sure
    about what someone meant by something, I try to ask them what
    they meant rather than jump to a conclusion. Admittedly, I
    don't always succeed, but I do try to follow that policy.
    --- Synchronet 3.21c-Linux NewsLink 1.2
  • From Keith Thompson@[email protected] to comp.lang.c on Sun Mar 1 19:42:38 2026
    From Newsgroup: comp.lang.c

    Tim Rentsch <[email protected]> writes:
    Keith Thompson <[email protected]> writes:
    Tim Rentsch <[email protected]> writes:
    Keith Thompson <[email protected]> writes:
    The more C is changed to resemble C++ the worse it becomes. It
    isn't surprising that you like it.
    I presume that was intended as a personal insult.
    It wasn't.

    Then you need to work on knowing when you've insulted someone.

    I see no reason to feel an obligation to know whether someone
    might feel insulted by something I say. Feeling insulted is a
    subjective reaction, not an objective truth. If someone said
    to me "it isn't surprising that you dislike C++" I might agree
    (or not) with them, but I don't feel insulted by it; all they
    are doing is giving their subjective reaction to my behavior.

    On the contrary, it seems presumptuous of you to judge that it
    was my intention to insult you. In cases where I'm not sure
    about what someone meant by something, I try to ask them what
    they meant rather than jump to a conclusion. Admittedly, I
    don't always succeed, but I do try to follow that policy.

    That's three times today that you've replied to a post I made a
    long time ago (about a year and a half in this case).

    I get the impression that you're stalking me. Please note that
    I have not asked whether that's your intent. I find it extremely
    annoying, for reasons I don't intend to explain further. I again
    encourage you to knock it off.
    --
    Keith Thompson (The_Other_Keith) [email protected]
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.21c-Linux NewsLink 1.2
  • From Michael S@[email protected] to comp.lang.c on Mon Mar 2 10:24:40 2026
    From Newsgroup: comp.lang.c

    On Sun, 01 Mar 2026 19:42:38 -0800
    Keith Thompson <[email protected]> wrote:

    Tim Rentsch <[email protected]> writes:
    Keith Thompson <[email protected]> writes:
    Tim Rentsch <[email protected]> writes:
    Keith Thompson <[email protected]> writes:
    The more C is changed to resemble C++ the worse it becomes. It
    isn't surprising that you like it.
    I presume that was intended as a personal insult.
    It wasn't.

    Then you need to work on knowing when you've insulted someone.

    I see no reason to feel an obligation to know whether someone
    might feel insulted by something I say. Feeling insulted is a
    subjective reaction, not an objective truth. If someone said
    to me "it isn't surprising that you dislike C++" I might agree
    (or not) with them, but I don't feel insulted by it; all they
    are doing is giving their subjective reaction to my behavior.

    On the contrary, it seems presumptuous of you to judge that it
    was my intention to insult you. In cases where I'm not sure
    about what someone meant by something, I try to ask them what
    they meant rather than jump to a conclusion. Admittedly, I
    don't always succeed, but I do try to follow that policy.

    That's three times today that you've replied to a post I made a
    long time ago (about a year and a half in this case).

    I get the impression that you're stalking me.

    It is appreciation.

    Please note that
    I have not asked whether that's your intent. I find it extremely
    annoying, for reasons I don't intend to explain further. I again
    encourage you to knock it off.



    --- Synchronet 3.21c-Linux NewsLink 1.2
  • From Keith Thompson@[email protected] to comp.lang.c on Mon Mar 2 04:43:04 2026
    From Newsgroup: comp.lang.c

    Michael S <[email protected]> writes:
    On Sun, 01 Mar 2026 19:42:38 -0800
    Keith Thompson <[email protected]> wrote:
    Tim Rentsch <[email protected]> writes:
    [...]
    I see no reason to feel an obligation to know whether someone
    might feel insulted by something I say.
    [...]
    That's three times today that you've replied to a post I made a
    long time ago (about a year and a half in this case).

    I get the impression that you're stalking me.

    It is appreciation.

    Do you speak for Tim?

    [...]
    --
    Keith Thompson (The_Other_Keith) [email protected]
    void Void(void) { Void(); } /* The recursive call of the void */
    --- Synchronet 3.21c-Linux NewsLink 1.2
  • From Bonita Montero@[email protected] to comp.lang.c on Sun Mar 8 13:39:40 2026
    From Newsgroup: comp.lang.c

    Am 01.08.2024 um 10:38 schrieb Richard Harnden:

    text is pointing to "this is a test" - and that is stored in the program binary and that's why can't modify it.

    Change it to:
    char text[] = "this is a test";
    You can modify that, text gets it's own copy.

    Better use C++. With C++ string literals are const char and usually
    occupies mapped non-writeable memory of the executable image. With
    a _const_ char * you easier geht an idea of what's going wrong here.
    --- Synchronet 3.21d-Linux NewsLink 1.2