Good morning,
I have to read values from an input file where each number represents a 12-bits value.
How can I do this in C++?
I created a
Qt Code:
  1. struct value_struct
  2. {
  3. unsigned value: 12;
  4. };
To copy to clipboard, switch view to plain text mode 

Then I used ifstream to read the value from the file
Qt Code:
  1. value_struct data;
  2. ifstream input;
  3. input.open("in.txt");
  4. if (!input)
  5. {
  6. //show error
  7. }
  8. input >> data.value; //gives a compiler error
To copy to clipboard, switch view to plain text mode