All pastes #1950052 Raw Edit

Miscellany

public c v1 · immutable
#1950052 ·published 2010-09-28 01:21 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include "plxheaderstruct.h"struct PL_FileHeader header; //PLXHEADER is defined in plxheaderstruct.h.  not necessary but it's practiceint main(){    FILE *plxfilepointer = fopen("test.plx", "rb"); //fopen() will return a pointer to a file in memory(?)    if (plxfilepointer == NULL) //if there isn't a file to point to...        {        printf("No File Found\n\n");        return 0; // bail out of main() AKA end program        }    printf("Found File at %p\n\n", plxfilepointer); //do stuff    fread(&header, sizeof(struct PL_FileHeader), 1, plxfilepointer); //read stuff    printf("Dumping some header info...\n\n");    printf("AD Frequency: %i\n", header.ADFrequency);    printf("Last Timestamp: %f\n\n", header.LastTimestamp); //why f? nothing else really works like %l for long..    fclose(plxfilepointer); //close file and free memory to OS    return 0;}