A B C D E F G H I J-K L M N O P Q-R S T U V W-Z
# preprocessor directive, 470
#define preprocessor directive, 465-467
#define statement
program extendibility, 301-302
#elif preprocessor statement, 316-317
#else preprocessor statement, 315
#endif preprocessor statement, 316
#error preprocessor directive, 467
#if preprocessor directive, 467-468
#if preprocessor statement, 316-317
#ifdef preprocessor directive, 468
#ifdef preprocessor statement, 314-316
#ifndef preprocessor directive, 468
#ifndef preprocessor statement, 314-316
#include preprocessor directive, 468-469
#include preprocessor statement, 311-314
#line preprocessor directive, 469
#pragma preprocessor directive, 469
#undef preprocessor directive, 469-470
#undef preprocessor statement, 317
absolute values, integers, calculating, 66, 128-130
absoluteValue() function, 128-134
addEntry() function, 388
Albahari, Joseph and Ben, 508
algorithms, 5
alphabetic() function, 210
ANSI.org, 506
arguments
arithmetic expressions, 21, 30-39
arithmetic operators, 31, 446-447
basic operations, 451
finding minimum value in, 138-141
generating Fibonacci numbers, 103-104
multidimensional, 113-115, 436-437
prime numbers, generating, 104-106
setting, gdb (GNU Debugger), 407-408
single-dimensional, 435
sorting, 143
using elements as counters, 100-103
ascending order, arrays, sorting into, 144-145
assembly language program, 9
changing array elements in functions, 141-143
atoi() function, 393
auto variable, 456
automatic local variables, 124-126, 155-158
base conversions, arrays, 109-111
BASIC programming language, 10
bitwise operators, 448
_Bool data type, 21, 24-28, 433
breakpoints, listing and deleting, gdb (GNU Debugger), 406
Budd, Timothy, 507
building programs, 9
C: A Reference Manual, 505
C Programming Language, The, 505
C# 5.0 in a Nutshell: The Definitive Reference, 508
C++ Primer Plus, 507
C++ Programming Language, The, 507
calculateTriangularNumber() function, 124-125
calculating
absolute values, integers, 66, 128-130
calling functions, 121-122, 130-137, 459
char *fgets (buffer, i, filePtr) function, 478
char *getenv (s) function, 493
char *gets (buffer) function, 480
char *strcat (s1, s2) function, 474
char *strchr (s, c) function, 474
char *strcoll (s1, s2) function, 474
char *strcpy (s1, s2) function, 474
char *strerror (n) function, 474
char *strncat (s1, s2, n) function, 474
char *strncpy (s1, s2, n) function, 475
char *strpbrk (s1, s2) function, 475
char *strrchr (s, c) function, 475
char *strstr (s1, s2) function, 475
char *strtok (s1, s2) function, 475
char variable, 24
character I/O (input/output), 346
character strings, 16, 193-194
counting characters in, 198-199
reading, 205
single-character input, 206-211
characters, diagraphs, 427
classes, storage, 456
closing files, fclose() function, 365-367
code. See also programs
Code::Blocks IDE, 507
CodeWarrior, 507
command-line arguments, 380-384
commands
general format, 495
compilers, 6
common mistakes, programming, 499-503
communication, between modules, 334-340
compiling
multiple source files from command line, 332-334
conditional compilation, 314-317
_Complex data type, 40
initializing structures, 178-179
compound relational tests, if statements, 72-74
compound statements, 460
computers
instruction set, 5
concatenating character strings, 197-201, 431-432
conditional compilation, preprocessor, 314-317
conditional operators, 90-92, 449-450
const keyword, 442
defined names, #define statement, 297-311
enumeration, 432
floating-point, 430
wide character, 431
continue statement, 62-63, 460
conversion characters
printf() function, 348
scanf() function, 353
conversion modifiers, scanf() function, 353
conversions
convertNumber() function, 152-154
copyString() function, 264-266, 269-270
counters, arrays, using elements as, 100-103
countWords() function, 210-211
Cox, Brad, 417
cvs utility, 343
CygWin, 506
data, formatting
_Complex, 40
conversions, 319, 325-328, 455-456
double_Complex, 433
extending, 319
data type conversions, 325-328
enumerated data types, 322
float_Complex, 433
_Imaginary, 40
int, 433
long double, 433
long double_Complex, 433
long int, 433
short int, 433
type definitions, 319
unsigned char, 433
unsigned int, 433
void, 433
dates, storing, structures, 164-169
debug code, compiling in, 393-394
debugging programs, 391
function calls, 459
variables, for loops, 56
decrement operators, 267-270, 448-449
defined names, constants, #define statement, 297-311
defining
multidimensional arrays, 436-437
pointers, 440
single-dimensional arrays, 435
variable-length arrays, 436
diagraphs, 427
directives, preprocessor, 465-470
#error, 467
#ifdef, 468
#ifndef, 468
#line, 469
#pragma, 469
displayConvertedNumber() function, 152
displaying
double acos (x) function, 486
double acosh (x) function, 487
double asin (x) function, 487
double asinh (x) function, 487
double atan (x) function, 487
double atan2 (y, x) function, 487
double atanh (x) function, 487
double atof (s) function, 483
double carg (z) function, 491
double ceil (x) function, 487
double cimag (z) function, 492
double complex cabs (z) function, 491
double complex cacos (z) function, 491
double complex cacosh (z) function, 491
double complex casin (z) function, 491
double complex casinh (z) function, 491
double complex catan (z) function, 491
double complex catanh (z) function, 492
double complex ccos (z) function, 492
double complex ccosh (z) function, 492
double complex cexp (z) function, 492
double complex clog (z) function, 492
double complex conj (z) function, 492
double complex cpow (y, z) function, 492
double complex cproj (z) function, 492
double complex creal (z) function, 492
double complex csin (z) function, 492
double complex csinh (z) function, 492
double complex csqrt (z) function, 492
double complex ctan (z) function, 492
double complex ctanh (z) function, 492
double copysign (x, y) function, 487
double cos (r) function, 487
double cosh (x) function, 487
double data type, 21-24, 28, 433
double erf (x) function, 487
double erfc (x) function, 487
double exp (x) function, 487
double expm1 (x) function, 487
double fabs (x) function, 488
double fdim (x, y) function, 488
double floor (x) function, 488
double fma (x, y, z) function, 488
double fmax (x, y) function, 488
double fmin (x, y) function, 488
double fmod (x, y) function, 488
double frexp (x, exp) function, 488
double ldexp (x, n) function, 488
double lgamma (x) function, 488
double log (x) function, 488
double log1p (x) function, 489
double log2 (x) function, 489
double log10 (x) function, 489
double logb (x) function, 489
double modf (x, ipart) function, 489
double nan (s) function, 490
double nearbyint (x) function, 490
double nextafter (x, y) function, 490
double nexttoward (x, ly) function, 490
double pow (x, y) function, 490
double remainder (x, y) function, 490
double remquo (x, y, quo) function, 490
double rint (x) function, 490
double round (x) function, 490
double scalbln (x, n) function, 490
double scalbn (x, n) function, 490
double sin (r) function, 490
double sinh (x) function, 490
double sqrt (x) function, 490
double strtod (s, end) function, 483-484
double tan (r) function, 490
double tanh (x) function, 490
double tgamma (x) function, 490
double trunc (x) function, 490
double_Complex data type, 433
dynamic memory allocation, 384-389
dynamic memory allocation functions, 484-485
enumerated data types, 319, 441
enumeration constants, 432
equality, character strings, testing for, 202-204
equalStrings() function, 202-204, 219
escape characters, character strings, 215-217
Exclusive-OR operator, 282-283
expressions, 442
arrays, basic operations, 451
data types, conversion of, 455-456
for loops, multiple, 55
assignment, 449
bitwise, 448
comma, 451
logical, 447
type cast, 450
structures
basic operations, 452
extendibility, programs, #define statement, 301-302
extending data types, 319
data type conversions, 325-328
enumerated data types, 319-323
external variables, 334-337, 456
factorials, calculating recursively, 158-159
Fibonacci numbers, generating, 103-104
fields
for loops, omitting, 55
FILE *fopen (fileName, accessMode) function, 478
FILE *freopen (fileName, accessMode, filePtr) function, 479
FILE *tmpfile (void) function, 482
FILE pointers, I/O (input/output), 368-369
files
closing, fclose() function, 365-367
naming, 7
programs, dividing into multiple, 331-334
reading and writing entire lines of data from and to, 367-368
reading single character from, 364
redirecting I/O (input/output) to, 358-362
renaming, 370
specifying lists and dependencies, 341-342
findEntry() function, 257
flags, printf(), 347
float data type, 21-23, 28, 433
float strtof (s, end) function, 484
float_Complex data type, 433
floating-point constants, 430
floating-point conversions, 36-38
for loops
formatted I/O (input/output), 346-358
formatting data
FORTRAN (FORmula TRANslation) language, 6
fprintf() function, 367, 392, 482
functions, 119
addEntry(), 388
alphabetic(), 210
atoi(), 393
automatic local variables, 124-126
calculateTriangularNumber(), 124-125
calling, 121-122, 130-137, 459
copyString(), 264-266, 269-270
displayConvertedNumber(), 152
dynamic memory allocation, 484-485
external versus static, 337-339
findEntry(), 257
getc(), 364
getNumberAndBase(), 151
isLeapYear(), 172
in-memory format conversion, 482-483
perror(), 371
pointers, 252-258, 272-273, 460
print_list(), 252
printf(), 13-17, 31-32, 119, 123, 137, 269, 345, 358
prototype declaration, 124
putc(), 364
putchar(), 346
return types, declaring, 133-135
scanf(), 59, 119, 177, 204-206, 358, 392
sort(), 143
squareRoot(), 131-134, 137, 155-156
static versus external, 337-339
storage classes, 456
test(), 254
top-down programming, 137
variables
writing, 120
general format, 495
gdb (GNU Debugger)
controlling program execution, 402-406
working with variables, 400-401
listing and deleting breakpoints, 406
obtaining stack trace, 406-407
setting arrays and structures, 407-408
source file display, 401
general utility functions, 492-494
generating
Fibonacci numbers, arrays, 103-104
prime numbers, arrays, 104-106
getc() function, 364
getchar() function, 207-208, 346, 362
getNumberAndBase() function, 151
global variables, functions, 151-155
Harbison, Samuel P. III, 505
identifiers, 428
predefined, 470
IDEs (Integrated Development Environments), 10, 506-507
if ( freopen ("inputData," "r", stdin) == NULL ) function, 479
compound relational tests, 72-74
illustrating
arrays and structures, 186-187
pointers, 235
structures, 165
_Imaginary data type, 40
increment operators, 267-270, 448-449
indirection, pointers, 233-234
initializing
in-memory format conversion functions, 482-483
inputting character strings, 204-206
instances, OOP (object-oriented programming), 414-416
instruction set, computers, 5
int abs (n) function, 493
int atoi (s) function, 483
int atol (s) function, 483
int atoll (s) function, 483
int fclose (filePtr) function, 478
int ferror (filePtr) function, 478
int fflush (filePtr) function, 478
int fgetc (filePtr) function, 478
int fgetpos (filePtr, fpos) function, 478
int fpclassify (x) function, 485
int fprintf (filePtr, format, arg1, arg2, argn) function, 479
int fputc (c, filePtr) function, 479
int fputs (buffer, filePtr) function, 479
int fscanf (filePtr, format, arg1, arg2, argn) function, 480
int fseek (filePtr, offset, mode) function, 480
int fsetpos (filePtr, fpos) function, 480
int getc (filePtr) function, 480
int getchar (void) function, 480
int hypot (x, y) function, 488
int ilogb (x) function, 488
int isfin (x) function, 486
int isgreater (x, y) function, 486
int isgreaterequal (x, y) function, 486
int isinf (x) function, 486
int islessequal (x, y) function, 486
int islessgreater (x, y) function, 486
int isnan (x) function, 486
int isnormal (x) function, 486
int isunordered (x, y) function, 486
int printf (format, arg1, arg2, argn) function, 481
int putc (c, filePtr) function, 481
int putchar(c) function, 481
int puts (buffer) function, 481
int remove (fileName) function, 481
int rename (fileName1, fileName2) function, 481
int scanf (format, arg1, arg2, argn) function, 482
int signbit (x) function, 486
int strcmp (s1, s2) function, 474
int strncmp (s1, s2, n) function, 475
int system (s) function, 494
int tolower(c) function, 477
int toupper(c) function, 477
int ungetc (c, filePtr) function, 482
integer constants, 22, 429-430
integer-point conversions, 36-38
integers
absolute values, calculating, 128-130
if statements, 66
Integrated Development Environments (IDEs), 10, 506-507
interpreters, 10
Introduction to Object-Oriented Programming, The, 507
I/O (input/output), 345
character, 346
fprintf() function, 367
fscanf() function, 367
getc() function, 364
putc() function, 364
rename() function, 370
I/O (input/output) functions, 477-482
isLeapYear() function, 172
JavaScript,
Kernighan, Brian W., 505
keywords
const, 442
restrict, 442
Kochan, Stephen, 508
interpreters, 10
Liberty, Jesse, 507
linked lists, pointers, 243-251
Linux, 7
initializing structures, 178-179
logical operators, 447
long double data type, 433
long double strtold (s, end) function, 484
long double_Complex data type, 433
long ftell (filePtr) function, 480
long int data type, 26-28, 433
long int labs (l) function, 493
long int lrint (x) function, 489
long int lround (x) function, 489
long int strtol (s, end, base) function, 484
long long int data type, 27-28
long long int llabs (ll) function, 493
long long int llrint (x) function, 489
long long int llround (x) function, 489
long long int strtoll (s, end, base) function, 484
loops, for
Mac OS X, 7
main() routine, 119-120, 126, 137
memory addresses, pointers, 273-275
memory allocation, dynamic, 384-389
methods, OOP (object-oriented programming), 414-416
Microsoft Windows, 7
MinGW (Minimalist GNU for Windows), 506
mistakes, programming, 499-503
modifiers, type, 442
modules, communication between, 334-340
multibyte characters, character strings, 432
multidimensional arrays, 113-115, 436-437
multidirectional arrays, 146-151
multiple expressions, for loops, 55
naming files, 7
Newton-Raphson Iteration Technique, 131-133
numberOfDays() function, 169-172
numbers
Fibonacci, generating, 103-104
numread = fread (text, sizeof (char), 80, in_file) function, 479
objects, OOP (object-oriented programming), 413-414
omitted variable, 456
omitting fields, for loops, 55
ones complement operator, 283-285
OOP (object-oriented programming)
defining
C# class to work with fractions, 424-426
writing program to work with fractions, 416
OpenGroup.org, 506
opening files, fopen() function, 362-364
##, 310
bitwise, 448
logical, 447
optimization, programs, 262
perror() function, 371
Petzold, Charles, 507
Plauger, P. J., 505
functions, 252-258, 272-273, 460
illustrating, 235
portability, programs, #define statement, 302-303
Prata, Stephen, 507
precision modifiers, printf() function, 347
predefined identifiers, 470
conditional compilation, 314-317
#error, 467
#ifdef, 468
#ifndef, 468
#line, 469
#pragma, 469
statements
#else statement, 315
#endif, 316
#undef statement, 317-
trigraph sequences, 464
prime numbers, generating, arrays, 104-106
print_list() function, 252
printf() function, 13-17, 31-32, 119, 123, 137, 269, 345, 358
conversion characters, 348
flags, 347
precision and width modifiers, 347
type modifiers, 347
printMessage() function, 120-121
program looping, 43
programming
OOP (object-oriented programming), 413
defining C# class to work with fractions, 424-426
defining objective-C class, 417-421
writing program to work with fractions, 416
top-down, 137
Programming C# 3.0, 507
Programming in Objective-C, 508
Programming in the Key of C#, 507
interpreters, 10
OOP (object-oriented programming), objects, 413-414
programs, 5
building, 9
conditional compilation, 314-317
debugging, 391
dividing into multiple files, 331-334
extendibility, #define statement, 301-302
forcing termination, exit() function, 369-370
optimization, 262
portability, #define statement, 302-303
prototype declaration, functions, 124
putc() function, 364
putchar() function, 346
qualifiers, type, 379
ranges, integers, 23
reading character strings, 205
register qualifier, 379
register variable, 456
relational operators, 46-50, 447-448
renaming files, rename() function, 370-371
restrict keyword, 442
results, functions, returning, 126-130
return types, functions, declaring, 133-135
returning function results, 126-130
Ritchie, Dennis M., 505
rotate() function, 288-291, 314-315
scanf() function, 59, 119, 177, 204-206, 358, 392
conversion characters, 353
conversion modifiers, 353
short int data type, 27-28, 433
single-character input, character strings, 206-211
single-dimensional arrays, 435
size_t fread (buffer, size, n, filePtr) function, 479
size_t fwrite (buffer, size, n, filePtr) function, 480
size_t strcspn (s1, s2) function, 474
size_t strlen (s) function, 474
size_t strspn (s1, s2) function, 475
size_t strxfrm (s1, s2, n) function, 475
sort() function, 143
sorting arrays, 143
source file display, gdb (GNU Debugger), 401
source files, compiling multiple from command line, 332-334
square roots, calculating, 130-133
squareRoot() function, 131-134, 137, 155-156
stack traces, obtaining, gdb (GNU Debugger), 406-407
Standard C Library, The, 505
standard header files, 471-473
statements, 460
compound, 460
debug, adding with preprocessor, 391-392
#define, preprocessor, 297-311
compound relational tests, 72-74
#include, preprocessor, 311-314
preprocessor
#else, 315
#endif, 316
#undef, 317
typedef, 441
static variables, 456
Steele, Guy L. Jr., 505
storage classes, 456
functions, 456
variables, 456
storage sizes, integers, 23
storing dates, structures, 164-169
stringLength() function, 198, 217
counting characters in, 198-199
reading, 205
single-character input, 206-211
string-to-number routines, 483-484
basic operations, 452
containing structures, 183-185
setting, gdb (GNU Debugger), 407-408
variants, 189
switch statement, 83-86, 463-464
system ("mkdir /usr/tmp/data") function, 494
tables, prime numbers, generating, 86-87
test() function, 254
testing character strings for equality, 202-204
tests, compound relational, if statements, 72-74
text editors, 7
top-down programming, 137
trigraph sequences, preprocessor, 464
type cast operator, 38-39, 450
type definitions, 319
type modifiers, 442
printf() function, 347
typedef statement, 441
universal character names, 428
Unix, 7
unsigned char data type, 433
unsigned int data type, 433
unsigned long int strtoul (s, end, base) function, 484
unsigned long long int strtoull (s, end, base) function, 484
unsigned specifier, 278
utilities
cvs, 343
values, variables, displaying, 15-17
variable-length arrays, 115-117, 436
variable-length character strings, 197-214
auto, 456
automatic local, 124-126, 155-158
char, 24
declaring, for loops, 56
extern, 456
omitted, 456
register, 456
storage classes, 456
volatile, 442
working with, gdb (GNU Debugger), 400-401
variants
structures, 189
vim text editor, 7
Visual Studio, 506
void *calloc (n, size) function, 484
void *malloc (size) function, 485
void *memchr (m1, c, n) function, 476
void *memcmp (m1, m2, n) function, 476
void *memcpy (m1, m2, n) function, 476
void *memmove (m1, m2, n) function, 476
void *memset (m1, c, n) function, 476
void *realloc (pointer, size) function, 485
void clearerr (filePtr) function, 477
void data type, 433
void exit (n) function, 493
void free (pointer) function, 485
void perror (message) function, 481
void qsort (arr, n, size, comp_fn) function, 493-494
void rewind (filePtr) function, 481
void srand (seed) function, 494
volatile qualifier, 379
volatile variable, 442
wide character constants, 431
wide character string constants, 432
width modifiers, printf() function, 347
writing functions, 120