Sams Teach Yourself C in 21 Days
/* A single-line comment */ int a,b,c; /* A partial-line comment */ /* a comment spanning multiple lines */ You should not use n ...
The Components of a C Program 35 2 Running the Program ......................................................................... ...
smart enough to recognize them as errors and report them to you. (You saw in yester- day’s material how the compiler reports err ...
The Components of a C Program 37 2 C:\>list_it list_it.c 1: /* list_it.c - This program displays a listing with line numbers! ...
fills lines 34 through 38. Braces enclose blocks throughout the program. Finally, only line 1 has a comment. In most programs, y ...
The Components of a C Program 39 2 what library functions are available is to buy a book that lists them. Appendix E, “Common C ...
14: 15: /* print asterisk line */ 16: void display_line(void) 17: { 18: int counter; 19: 20: for( counter = 0; counter < 30; ...
DAY 3 WEEK 1 Storing Information: Variables and Constants Computer programs usually work with different types of data and need a ...
Understanding Your Computer’s Memory ............................................................ If you already know how a comp ...
Storing Information: Variables and Constants 43 3 works. Whether your program is maintaining an address list, monitoring the sto ...
Because C is case-sensitive, the names percent,PERCENT, andPercentwould be consid- ered three different variables. C programmers ...
Storing Information: Variables and Constants 45 3 (123,000,000, 3.14, or 0.000000871256, for example) require more storage space ...
Looking at Table 3.2, you might notice that the variable types intandshortare identi- cal. Why are two different types necessary ...
Storing Information: Variables and Constants 47 3 14: printf( “\nAn unsigned int is %d bytes”, sizeof( unsigned int )); 15: prin ...
The size of a charis one byte. The size of a shortis less than or equal to the size of an int. The size of an intis less than o ...
Storing Information: Variables and Constants 49 3 typenamespecifies the variable type and must be one of the keywords listed in ...
in an algebraic statement, you are stating a fact: “x equals 12.” In C, however, it means something quite different. In C it mea ...
Storing Information: Variables and Constants 51 3 Literal Constants ............................................................ ...
A constant starting with 0x or 0X is interpreted as a hexadecimal constant (the base-16 number system). Hexadecimal constants c ...
Storing Information: Variables and Constants 53 3 symbolic constant, you need to make a change only in the place where the const ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf