Skip to Main Content
Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles
book

Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles

by James S. Evans - Lawrence University, Gregory L. Trimper - viika
April 2003
Intermediate to advanced content levelIntermediate to advanced
576 pages
15h 13m
English
Pearson
Content preview from Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles

9.6. SCANFILE: Input and Output with Files

Figure 9-5 continues the progression of SCANTEXT and SCANTERM by presenting SCANFILE. We have designed a program that loops through an input text file and places into an output text file each isolated word (with any trailing punctuation) on a separate line. The SCANFILE program also counts the number of words, which will be the number of lines in the output file, and displays that value on the screen.

Figure 9-5. SCANFILE: Using C-like input and output with files
 // SCANFILE Demonstrate I/O for files // This program does lexical analysis by reading "words" // from a text file using fscanf. These separate words are // then written out, one per line, using fprintf. BUFL = 80 // Allowance for a "word" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ARM System Developer's Guide

ARM System Developer's Guide

Andrew Sloss, Dominic Symes, Chris Wright
Intel Xeon Phi Processor High Performance Programming, 2nd Edition

Intel Xeon Phi Processor High Performance Programming, 2nd Edition

James Jeffers, James Reinders, Avinash Sodani

Publisher Resources

ISBN: 0131013726Purchase book