i've written this code in which i read values from a binary(.dat) file. The file has got 2 sets of values. Index values(0-360) and the corresponding amplitude. The amplitude can be upto a 5 digit negative or positive number. I have defined the struct as foll:
struct snip
{
int n;
unsigned x;
};
for 'x' when i defined it as float or double it would'nt read the values properly, but when using unsigned, it works fine except that it does'nt read the negative values the way it is, instead the negatives values r stored as some really large number.....can some1 pleaseee heelp me out..........its is killing me tht i cant figure out wht to do,............