3 ms·
Consider a program that reads two numbers input by the user, divides them, and prints the result. Can it really be that because it's POSSIBLE for the user to e
by radford-neal 9y ago
Consider a program that reads two numbers input by the user, divides them, and prints the result. Can it really be that because it's POSSIBLE for the user to enter zero for the second number, that the compiler is allowed to replace this program by one that removes all your files (even when the user DIDN'T enter zero)?
The C standard writers may have been unwise to specify undefined behaviour the way they did, but they weren't THAT crazy!