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
struct value_struct
{
unsigned value: 12;
};
struct value_struct
{
unsigned value: 12;
};
To copy to clipboard, switch view to plain text mode
Then I used ifstream to read the value from the file
value_struct data;
ifstream input;
input.open("in.txt");
if (!input)
{
//show error
}
input >> data.value; //gives a compiler error
value_struct data;
ifstream input;
input.open("in.txt");
if (!input)
{
//show error
}
input >> data.value; //gives a compiler error
To copy to clipboard, switch view to plain text mode
Bookmarks