Sams Teach Yourself C in 21 Days
33 × 102 = 3 ×100 = 300 44 × 101 = 4 ×10 = 40 22 × 100 = 2 ×1 = 2 Sum = 342 The base-10 system requires 10 different digits, 0 t ...
Working with Binary and Hexadecimal Numbers 795 C The hexadecimal system (often called the hex system) is useful in computer wor ...
46 448201x-APP C 8/13/02 11:22 AM Page 796 ...
APPENDIX D Portability Issues The term portabilityrefers to the ease with which a program’s source code can be moved from one pl ...
committee sets standards for many areas, including other programming languages. Almost all C compilers provide the option of adh ...
Portability Issues 799 D 28: 29: printf( “\n\nDone printing the values!\n” ); 30: 31: return 0; 32: } Print the values of the va ...
listD01.c: Error listD01.c 16: Multiple declaration for ‘var1’ in function main *** 1 errors in Compile *** Portable Characters ...
Portability Issues 801 D To compile a program using Borland’s C++ command line, you would enter the follow- ing on the command l ...
Variables and Constants,” Table 3.1 presented the values typically stored in IBM-compat- ible PCs. However, these values aren’t ...
Portability Issues 803 D Variable Type Sizes ========================= char 1 short 2 int 2 float 4 double 8 unsigned char 1 uns ...
Floating Decimal Sizes 4 * 3.4 E–38 3.4 E38 8 ** 1.7 E–308 1.7 E308 10 *** 3.4 E–4932 1.1 E4932 *Precision taken to 7 digits. ** ...
Portability Issues 805 D SCHAR_MIN Signed character variable’s minimum value. SCHAR_MAX Signed character variable’s maximum valu ...
DBL_MIN_EXP Double variable’s exponent minimum value (base 2). LDBL_MAX Long double variable’s maximum value. LDBL_MAX_10_DBL Lo ...
Portability Issues 807 D 26: printf( “\n ULONG_MAX %e “, ULONG_MAX ); 27: printf( “\n FLT_DIG %d “, FLT_DIG ); 28: printf( “\n D ...
LISTINGD.4 Using the ANSI-defined constants 1: /*==========================================================* 2: * Program: listD ...
Portability Issues 809 D Listing D.4 shows the UCHAR_MAXconstant in action. The first new items you should notice are the includ ...
6: #include <stdio.h> 7: int main(void) 8: { 9: unsigned char x = 0; 10: char trash[256]; /* used to remove extra keys */ ...
Portability Issues 811 D Enter a character (Q to quit) ==> * * is not a letter of the alphabet! Enter a character (Q to quit) ...
variable is equal to ‘A’, but you wouldn’t want to check to see whether the value of a character is greater than ‘A’. if( X > ...
Portability Issues 813 D 37: } 38: printf(“\n\nThank you for playing!\n”); 39: return(0); 40: } Enter a character (Q to quit) == ...
«
37
38
39
40
41
42
43
44
45
46
»
Free download pdf