08.01.2023 Views

Learn to Program with C_ Learn to Program using the Popular C Programming Language ( PDFDrive )

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ index

Strings (cont.)

for statement, 218

numSpaces, 216

properly terminating, 214

relational operators, 214

reverse function, 219–220

str, 217

while loop, 216

getString function, 228–229

length of, 215

name of day

nameOfDay, 225

printDay, 225

two-dimensional array, 226–227

values, 227

null string, 214

printf, 216

stored format, 213

strcmp function, 214

strlen function, 215

while loop, 217

struct keyword, 280

Structures

approaches, 279

array of, 285–287

declaration, 280–282

fractions, 293–295

functions, 304

member operator, 281

need for, 279

nested structure, 292–293

process data, 279

read, search and sort, 288–291

typedef, 283–284

voting problem, 295–302, 304

Symbolic constants

#define directive, 81–82

definition, 80–81

MaxRegularHours, 82

OvertimeFactor, 82

program illustration, 81

• T, U

Temperature conversion table, 129, 131

Triangle classification, 85–86

typedef

Date structure, 283

declare variables, 285

dob structure, 284

int type, 283

printDate keyword, 284

structure variables, 283

Whole keyword, 283

• V

Value, 142

Variable-length

arrays (VLAs), 260–262

Voting problem of structures

array and simple-variable

arguments, 295

C structures, 296

descending order, 303

getLargest, 300

initialize function, 297

numVotes function, 303

PersonData and VoteCount

function, 299

printResults, 299–302

processVotes, 298

results.txt, 296

sortByName function, 303

structure declarations, 298

symbolic constants, 297

votes.txt, 296

• W, X, Y, Z

while condition, 150–151

while statement, 149

Word frequency count

advantage, 267

approach, 267–270

outline development, 266

possibilities, 266

search and insert, 266

sequences, 270–271

Write characters

declaration, 157

echo input and

number lines, 157–161

putc function, 157

312

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!