RAII equivalent idiom in C for error handling

RAII is great for error handling in C++. Is there any equivalent idiom in C?

asked Mar 5, 2014 by Eric Z Ma (44,280 points)

1 Answer

Best answer

Please check the discussion in this post https://www.systutorials.com/5311/raii-like-error-handling-and-resource-management-in-c/ which discussed how to organize the C code to provide RAII-like semantics.

answered Mar 5, 2014 by Eric Z Ma (44,280 points)
edited Mar 6, 2014 by Eric Z Ma

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost