swh:1:snp:9afa324ac020f1c169cae2c8f220a29e1ff11375
Raw File
Tip revision: 44671f9d687ae602c6486d396d0a9733aad7f93e authored by David Shorten on 23 March 2022, 10:01:34 UTC
basic degree correlations
Tip revision: 44671f9
c_reader.cpp
//#include <iostream>
//#include <fstream>
#include <stdio.h>
//using namespace std;

typedef struct {	
    unsigned long long time;
    short channel;
    short height;	
    short width;	
    short context[74];	
    short threshold;	
} Spikeinfo;

int main() {

    int NUM_SPIKES = 10;

    FILE *pFile;
    pFile = fopen ("spikes1.txt","w");
    
    //ofstream myfile;
    //myfile.open ("spikes1.txt");

    Spikeinfo buffer[NUM_SPIKES];
    int n;
    FILE *fh;

    fh = fopen("1-3-5.5.spike","rb+");
    n = fread(buffer, sizeof(Spikeinfo), NUM_SPIKES, fh);

    for(int j = 0; j < NUM_SPIKES; j++) {
	printf("%llu ", buffer[j].time);
	printf("%hd \n", buffer[j].channel);
	//fprintf(pFile, "%hu ", buffer[j].channel);
	//myfile << buffer[j].channel << " " << buffer[j].time << endl;
    }
    fclose(pFile);

    //myfile.close();
    return 0;
}
back to top