By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

Exception Handling

P: 7
Why C does not exhibit the Exception Handling?
Apr 17 '19 #1
Share this Question
Share on Google+
2 Replies

P: 4
Exception handling is one of the major Disadvantges of C programming language. C doesn't provide direct support to errors or exceptional handling. Since it is system programming language it does provide low level errors handling in the form of return values.
C will return -1 or NULL, in the case of errors.
Apr 17 '19 #2

Expert 100+
P: 2,400
I don't think it is accurate to say C doesn't provide Exception Handling. <signal.h> and <setjmp.h> could conceivably be used for exception handling. What you mean is C doesn't provide the kind of Exception Handling that you want.

The answers to "Why does C do this?" and "Why doesn't C do that?" are usually the same:
  • C was developed in 1972. C has been tremendously successful. There is great reluctance to introduce new features that might break existing code.
  • C has traditionally been a what-you-see-is-what-you-get language with a lean runtime library. There is reluctance to introduce new features that require complicated unseen behavior in the runtime library.
Apr 17 '19 #3

Post your reply

Sign in to post your reply or Sign up for a free account.