I have to read " -10899 "(and many more integers) from a text file into an integer variable in C.
This is what I have so far:
int i = 0;
// get data from file and convert to int
for(; i < (2 * (_sym * (_roll_off + _symbol_len))) && fgets(ifft_out, 12, fp) != NULL; i++ )
{
a = atoi(ifft_out);
a &= 0xFFFFFFFF;
ifft_data[i] = a;
}
It reads as "-9083" into the variable, not sure whats wrong here.
P.S: ifft_out is a char
User contributions licensed under CC BY-SA 3.0