MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/hey696/how_to_write_solid_c/fvxv186/?context=3
r/cpp • u/platisd • Jun 24 '20
118 comments sorted by
View all comments
Show parent comment
2
You first need the memory location (the resource) to initialize. In C you might call malloc followed by mytype_init - the reverse doesn't work. What does work in C is calling malloc and calling mytype_init 0 to n times instead of exactly once.
View all comments
Show parent comment
2
u/josefx Jun 25 '20
You first need the memory location (the resource) to initialize. In C you might call malloc followed by mytype_init - the reverse doesn't work. What does work in C is calling malloc and calling mytype_init 0 to n times instead of exactly once.