Finally I have a valid reason to learn about memory management. It was also hella weird when encountering it.

  • ulterno@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 days ago

    Back when I was a kid and was learning C, I used to wonder why people considered pointers hard.
    My usage of pointers was like:

    void func (int * arg1)
    {
        // do sth with arg1
    }
    int main ()
    {
        int x;
        func (&x);
        return 0;
    }
    

    I didn’t know stuff like malloc and never felt the need in any of the program logic for the little thingies I made.
    Pointers are not hard. Memory management makes it hard.