In-Class Practice
Tables
Write a program that reads accounting records from
a file named input.dat and displays
the information in tabular form on standard output.
Each record in the file contains the information for a
single transaction and is delimited by a newline character.
For example, a transaction record looks like
The first field contains the account number, the second field contains
the transaction amount, and the third field contains a description of
the transaction, which may include blank characters.
A semi-colon character delimits adjacent fields.
Complete the following code:
// Accounting Records
//
#include <stdio.h>
int main(void)
{
int rc;
FILE* fp = NULL;
if (fp != NULL) {
do {
} while (rc == 3);
}
else {
}
return 0;
} |
|