#include <stdio.h>
#include <stdlib.h>
#define SIZE 80

/** Midterm2 program: Read from the file data.txt
 *
 * Example output:
 * % ./a.out 
 * line is: jack of all            trades
 * number is: 417
 * % 
 **/
int main(){

    int data;
    char nextLine[SIZE];
    FILE * in;

    in = fopen("data.txt", "r");

    if (in == NULL) {
        printf("Error opening file data.txt\n");
        exit(1);
    }

    /* read in a whole line of text from the file */

    fgets(nextLine, SIZE, in);

    /* print the line of text */

    printf("line is: %s", nextLine);

    /* read in one integer from the file*/

    fscanf(in, "%d", &data);

    /* print the integer */

    printf("number is: %d\n", data);
    
    fclose(in);

    return 0;
}
