unspecified, and undefined behavior?
If you’re writing portable code, ignore the distinctions. Otherwise, see the full list. 11.34: I’m appalled that the ANSI Standard leaves so many issues undefined. A: In most of these cases, the Standard is simply codifying existing practice. 11.35: I just tried some allegedly-undefined code on an ANSI-conforming compiler, and got the results I expected. A: A compiler may do anything it likes when faced with undefined behavior, including doing what you expect. Section 12. Stdio 12.1: What’s wrong with the code “char c; while((c = getchar()) != EOF) …”? A: The variable to hold getchar’s return value must be an int. 12.2: Why won’t the code “while(!
Related Questions
- People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. Whats the difference?
- People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. What do these mean?
- Whats the difference between implementation-defined, unspecified, and undefined behavior?