converting some python code to C. 'just' want to declare a typedef structure and a pointer to it... this is segfaulting at printf( "byte order %p\n", info->byte_order); How is this supposed to be done? please help. Trying to follow C typedef of pointer to structure but I guess it is outdated.
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#include <Byteswap.h>
#define WFM_HEADER_SIZE 838
typedef struct WfmInfo{
uint16_t byte_order;
// char version[8];
uint32_t imp_dim_count;
uint32_t exp_dim_count;
uint32_t record_type;
uint32_t exp_dim_1_type;
uint32_t time_base_1;
uint32_t fastframe;
uint32_t Frames;
double tstart;
double tscale;
double tfrac;
double tdatefrac;
int32_t tdate;
uint32_t dformat;
double vscale;
double voffset;
uint32_t pre_values;
uint32_t post_values;
uint32_t avilable_values;
uint32_t dpre;
uint32_t dpost;
uint16_t bps;
uint32_t code;
uint32_t readbytes;
uint32_t allbytes ;
uint32_t samples;
uint64_t curve_offset;
uint32_t available_values;
} WfmInfo;
typedef WfmInfo* WfmInfo_ptr;
int testFuck(){
WfmInfo_ptr info;
printf( "info address %p\n", info);
printf( "byte order %p\n", info->byte_order);
cout<<"info declared"<<endl;
return 0;
}