at the end of main, why gc is implemented by high-level languages? It is special implementation on C++ or other languages which care about memory management on implicitly like smart pointers. However, in C or C++ if you use raw pointers and you allocate memory from heap, you have to give it back into system. As I said, otherwise memory leak will be happened, if you do not believe me, run your code with "-fsanitize=address -g" flags with clang and see.
good point, let me check again maybe it's just true about file descriptors
Обсуждают сегодня