The Department of Computer Science & Engineering |
STUART C. SHAPIRO: CSE
305
|
6.3.1.4 Real floating and integer
...
[#1] When a finite value of real floating type is converted to integer type other than _Bool, the fractional part is discarded (i.e., the value is truncated toward zero). If the value of the integral part cannot be represented by the integer type, the behavior is undefined.
[ISO C Standard JTC1/SC22/WG14 N843]
Manual are written for programmers. They should specify all the operations, but some specifications may be implementation-dependent.
A
in
the below C program?
#include <stdio.h> void sub() { int x = 2; printf("In sub, x = %d\n", x); } int main() { int x = 1; printf("In main, x = %d\n", x); A: sub(); printf("In main, x = %d\n", x); return 0; }
x
given the value 1
in
the above C program?
This course will not be structured by these categories, but by PL components that all, or most, PLs have.