フィルターのクリア

how to read boolean data type in fread

10 ビュー (過去 30 日間)
kumar panduga
kumar panduga 2016 年 5 月 3 日
回答済み: Walter Roberson 2016 年 5 月 3 日
can we boolean data type in fread??

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 5 月 3 日
The storage representation of C++'s boolean is not defined by the standards; see http://stackoverflow.com/questions/19351483/how-is-a-bool-represented-in-memory. It could vary from compiler to compiler. The bitfields that are boolean need to be watched out for; see http://stackoverflow.com/questions/308364/c-bitfield-packing-with-bools and note that compilers differ in whether they start packing the bitfields from the MSB or the LSB.
As the size is not known, it is not generally possible to read boolean.
If you know the size in bytes then that information could be used to do the reading.

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by