Best way to handle memory allocation in C?

后端 未结 12 1766
春和景丽
春和景丽 2021-01-31 11:58

I think I\'ve got a good grasp on how to handle memory in C++ but doing it in C is different I\'m a bit off.

In C++ I\'ve got constructors and destructors, I\'ve got the

12条回答
  •  情话喂你
    2021-01-31 12:33

    I don't know how to hide them and how to automate things.

    C and C++ are different languages. Now, say that a hundred times to yourself. Be loud.

    What do you mean by hiding? What do you mean by automate? Can you post some examples? Why do you need to hide and/or automate.

    Good places online to start off with C memory allocation are:

    • The C FAQ (Particularly, Chapter 7)
    • The Ten Commandments for C Programmers

提交回复
热议问题