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.7. SORTINT: Sorting Integers from a File

As a second example of working with files, we present a companion to the SORTSTR program, which performed a bubble sort on strings entered interactively. The SORTINT program (Figure 9-6) reads integer quantities from an ASCII text file into internal binary storage as quad words, sorts them using the bubble sort algorithm, and writes the ordered list of signed integers to a new text file, one per line. This program utilizes I/O features of the SCANFILE program to implement the bubble algorithm of the SORTSTR program.

Figure 9-6. SORTINT: Bubble sort for integer quantities
 // SORTINT Bubble sort integers from a file // This program will read 100 or fewer integers from a // text file, sort them using the ...
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