3 ms·
Nothing stops you from coding a semantically equivalent solution in C, just with structs and function calls that abstract over the details of io and calling rea
by david2ndaccount 6y ago
Nothing stops you from coding a semantically equivalent solution in C, just with structs and function calls that abstract over the details of io and calling realloc correctly.
- windowojji 6y agoDoes C have destructors?
- jonathankoren 6y agoOnly if you make it and call it. C has free, which deallocates a block of memory pointed to by a pointer. If it's a struct, the struct is deallocated. If the struct contains pointers, that memory is still there. If you've lose all the pointers to that chunk of memory, you now have a memory leak. It is not uncommon to make your own allocators and deallocaters for complex structs.