Error handling techniques when using API

Asked 2 years ago, Updated 2 years ago, 94 views

Hi, how are you?

I have a question about the exception processing technique while writing code using C.

When implementing several APIs, it uses hundreds of APIs such as free/fwrite/fseak

function allows big burden to implement the error handling code of 500 500.

Is there a theory that implements exception processing routines by structuring code?

Thank you.

c exception-handling api

2022-09-21 14:34

1 Answers

Usually, try-catch is used in other languages, but it seems difficult because c does not support it.

I searched and found that you use goto or setjmp/longjmp to use try-catch similarly in c.

See also here.


2022-09-21 14:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.