c++ - Code with undefined behavior in C# -
There are many ways in C ++ that you can write codes that compile, but yields Is something similar in C #? Can we write code in C # that compile, but what is undefined behavior?
As others have pointed out, nothing much more "unsafe" blocks implement implementation-defined behavior Can provide; Misuse of unprotected blocks can change the byte of the code that you make the runtime itself, and therefore all the bets are closed.
In the case of the integer division corner, there is implementation-defined behavior.
Leaving an exception and catching it ever causes the implementation-defining behavior - the process ends, a debugger starts, and so on.
There are many other situations in C # where we are forced to release the emitted code which has implementation behavior. For example, this situation:
However, the implementation-defined behavior in a safe, streamlined C # program must be quite scarce in situations.
Comments
Post a Comment