Professional Documents
Culture Documents
I
Index
SYMBOLS addresses
array tags, 183-184
# (stringizing operator) and macros, 89 base, 178
## (concatenation operator), 101-102 beyond array endpoints, 177-179
macros, 89 offset, 178
% (modulus operator), 14 printing, 157-158
&array_name compared to array_name, algorithms
184 searching, 32-33
*/ symbol (comments), 98 bsearch( ) function, 48-50
++ operator (increment operator), 13 complexity, 33-34
++var compared to var++, 13-14 sorting, 31-34
/* symbol (comments), 98 Allman brace style, 338
// symbol (comments), 98, 279 allocating
32-bit compilers, 356-357 file handles, 81
64KB limit for arrays, 150 memory, 132-158
heaps, 152-153
A malloc( ) and calloc( ), 149
sizing, 156
Abort message, 81-83 stacks, 151-152
access Windows, 413
denying file access, 79 alphabetical characters, 374-375
DOS (Disk Operating System) memory animated bitmaps, Windows, 403
locations, 260-262 animated text, writing text to screen, 296
acos( ) function, 239 ANSI (American National Standards
adding Institute), 283-291
pointers, 143-144 C++ (Windows compiler compatibility),
values to pointers, 141-142 395
416 ANSI
enum compared to #define, ctype.h header file, 232 converting to single numbers,
95-96 curses package (cursor 243-247
system colors (Windows), positioning), 295 sorting, 245
406-407 cursors storing, 243-247, 252
type casts, 27 compared to carets dead keys (Windows), 400-401
volatile variables, 21 (Windows), 401-402 debugging, 197-213
continue vs. break statements, moving (ANSI driver), equality operators, 206
346 313-314 excessive execution time,
controls, 407-408 positioning, 294-295 200-202
conventions restoring cursor positions failed conditions, 212-213
naming (variables), 332 (ANSI driver), 312 hanging programs, 197-203
programs, 233 saving cursor positions (ANSI implicitly cast variables,
converting driver), 311-312 206-207
date variables to single infinite loops, 199-200
numbers, 243-247 D input problems, 202-203
numbers to strings, 124-126 data files, 63-85 memory leaks, 203-204
strings to numbers, 126-128 Abort, Fail, Retry messages, methods, 204-211
time variables to single 81-83 nested for loops, 202
numbers, 248-251 attributes, 75-76 symbolic debuggers
cooperative multitasking, 357 binary mode, 67 (enumerated constants), 96
copying comma-delimited text, 83-85 tools, 205-207
string sections, 123-124 date and time lists, 70-72 TSR (terminate and stay
strings, 228 denying access, 79 resident) programs, 211-212
core dumps, 155-156 errno variable and nonzero uninitialized variables, 206
cos( ) function, 239 numbers, 63-64 declaring
cosh( ) function, 239 file handle allocation, 81 arguments in argument lists,
_ _cplusplus symbol and file lists in directories, 68-69 288-289
compiling C++, 106 filename sorting in directories, array sizes at runtime, 147-148
CPU (Central Processing Unit), 73-74 constants with
263 locking files, 79-80 const, 29
CreateDialog( ) function, 414 opening in shared mode, #decline, 93-94
CreatePen( ) function, 390 77-79 enum, 94
CreateWindow( ) function, 388, passing data, 363-368 functions, 159-162
407-408 PATH environment variable, static variables in headers, 28
edit class, 410-411 76-77 variables, 28, 271
listbox class, 411-412 sharing files, 79-80 in headers, 27
creating storing data, 16-29 local blocks, 2
buttons (Windows), 407-408 streams, 64 default cases, 4-5
.COM files, 319 text mode, 67 #define directive (preprocessor),
controls (Windows), 407-408 writing to the screen, 295-296 92
delay timers for DOS, 353 data segments (variable constant declarations, 93-94
libraries, 321-322 storage), 16 compared to enumerated
random numbers, 354-356 data types and scanf( ), 303 constants, 95-96
critical error handler (interrupt _ _DATE_ _ preprocessor macros, 88-89
24), 81 command, 109-110 undefining (preprocessor),
Ctrl-Alt-Delete (disabling warm date and time, 70-72 111-112
boots), 372-374 compile date and time true/false, 344
Ctrl-Break (stopping program (preprocessor), 110 defining
execution), 300-301 Windows, 404 headers at compile time
disabling, 370-372 date variables, 243-253 (preprocessor), 100
Windows program interrupts, NULL as 0, 142
388
factorials,calculating 419
standard library functions, DOS (Disk Operating System) errno variable (nonzero
216-223 BIOS, 262 numbers), 63-64
true/false, 344-345 command-line parameters, error handling
variables, 27-28 351-352 bus errors, 155-156
DefWindowProc( ) function, delay timers, 353 core dumps, 155-156
402 fitting applications, 324-325 debugging, 197-213
delay timers functions DGROUP: group exceeds
creating for DOS, 353 calling, 257-258 64K message, 323-324
Windows, 387 compared to Windows, excessive program execution
demo programs, disabling 392-393 time, 200-202
(preprocessor), 97 interrupts 62, command-line hardware, 81-83
denying file access, 79 parameters, 352 infinite loops, 199-200
detecting memory leaks, memory locations, accessing, input problems, 202-203
203-204 260-262 memory faults, 155-156
device contexts, 386 undocumented functions, 258 null pointers, 137
GDI (Graphic Device DOS Busy Flag, 258 assignment errors, 155-156
Interface), 389 DOS extenders (memory preventing, 208-211
HDC (handle), 394 management), 325 printing error locations
DGROUP: group exceeds 64K double-precision floating point, (preprocessor), 104
message, 323-324 239 source file errors, printing
dialog boxes (modal and doubles (numbers), 308 (preprocessor), 105
modeless), 414 dup( ) function, 65-66 escape characters, 382-383
DialogBox( ) function, 414 dynamic linking (Windows), events, see interrupts
digital trie searching algorithm, 393 exception handling, 352
50-55 dynamic memory exchange sorts, 32
directories allocating, 324 .EXE files, 319-321
filenames, sorting, 73-74 calloc( ), 149 printf( ) function, 296
listing files, 68-69 malloc( ), 149 exec( ) function, 361-362
searching for executing memory leaks, 203 execution
programs, 368-369 loops, 7-8
disabling E sequential program execution,
Break key, 301 edit class (Windows), 410-411 361-362
Ctrl-Break, 370-372 editing in Windows, 401-402 simultaneous program
demo programs (preprocessor), efficiency of programs execution, 362-363
97 comments, 333-334 stopping with Ctrl-Break,
warm boots (Ctrl-Alt-Delete), naming variables, 336-337 300-301
372-374 recursion, 343 Exit command (File menu), 388
disk swapping (memory white space, 334-336 exit( ) function and return
management), 325 EMS (expanded memory), 326 statements, 171-173
display modes, 265-269 enumerated constants exiting Windows programs,
screen output, 293-294 compared to #define 388-389
distribution sorts, 32 (symbolic) constants, 95-96 exp( ) function, 239
DLLs (dynamic link libraries) declaring constants, 94 expanded memory (EMS), 326
and Windows, 393 symbolic debuggers, 96 extended display modes, 268
dollars-and-cents values, use with true/false, 344 extended memory (XMS), 326
printing, 307-309 environment variables, 256-257 external scope, 165
_dos_findfirst( ) function, environments, free-standing external sorts, 32, 44-48
68-69, 369 and hosted, 225
_dos_findnext( ) function, equality operators F
68-69, 369 compile-time checking, 206 fabs( ) function, 240
_dos_getvect( ) function, 374 precedence, 286 factorials, calculating, 342-344
420 Fail message
cursor positions (ANSI driver), digital trie, 50-55 sizeof operator (arrays),
312 hashing, 33, 55-57 179-180
redirected standard streams, linear searching, 50 sizing
65-66 linked lists, 57 allocated memory, 156
retrieving environment radix searching, 33 arrays
variables, 256-257 sample codes, 57-62 at runtime, 147-148
Retry message, 81-83 sequential searching, 33 constant values, 185
return statements speed of execution, 33-35, client areas (Windows),
exit( ) function, 171-173 50-55 396-397
void functions, 166 secondary data storage (sorting Small memory model, 317-319
return( ) function, 271 algorithms), 44-48 Software Development Kit
returning values with segmented architecture, 179 (SDK)
main( ), 290 selection sorts, 32 C++, 392
reusable functions (libraries), SelectObject( ) function, 390 Windows, 391-392
321-322 sentinel values (null pointers), software interrupts, 263
RGB values (Windows system 137-138 some_func( ) function, 162-163
colors), 406 sequential searching, 33 sopen( ) function, 77-79
right-justification of strings, _setargv( ) function, 350 sort_files( ) function, 74
120-122 SET_FLAG( ) macro, 193 sorting
Ritchie, Dennis M., 353 SET_MFLAG( ) macro, 193 date variables, 245
rjust( ) function, 120-122 setjmp( ) function, 8-10, filenames in directories, 73-74
rtrim( ) function, 117-122 233-234 linked lists, 57
running programs setjmp.h header file, 234 sorting algorithms, 31-32
sequentially, 361-362 setlocale( ) function, 233 complexity, 33-34
simultaneously, 362-363 SetSysColor( ) function and distribution sorts, 32
rvalues, 12 Windows, 406 exchange sorts, 32
SetTimer( ) function and external sorts, 32, 44-48
S Windows, 387 insertion sorts, 31
saving setting internal sorts, 32
cursor positions (ANSI driver), breakpoints, 205 merge sorts, 32, 40-42
311-312 watches, 205 natural, 32
windows, 395-396 SetupFilters( ) function, 360 qsort( ) function, 36-37
scan statements (strings), 306 setvbuf( ) function, 294 quick sorts, 38-40
scanf( ) function, 302-303 SetWindowLong( ) function, radix sorts, 43-44
scientific notation, printing, 409 sample codes, 57-62
310 SetWindowText( ) function, selection sorts, 32
scope (functions), 165 405 speed of execution, 33-35,
screens shared files, 79-80 37-44
clearing with the ANSI driver, shared memory (volatile stable, 32
311 modifier), 20-21 source code
color (ANSI driver), 312 shared mode (opening files), comments, 334
output, 293-294 77-79 modular programming, 316
SDK (Software Development shorts, 280 source files
Kit) signal handlers, 235 errors, printing, 105
C++, 392 signal( ) function, 235 library functions, 320
Windows, 391-392 signal.h header file, 235 line numbers, printing, 109
searching algorithms, 32-33 signals, 235-236 multiple library functions, 321
binary searching, 49 disabling Ctrl-Break, 371-372 names, printing, 108
bsearch( ) function, 48-50 sin( ) function, 239 writing programs, 316
comparison searching, 33 sinh( ) function, 239 spaces in strings, 129
complexity, 33-34 spawn( ) function, 361-362
428 speed of execution