C++ Programming on Linux QFile class view binary file in Heximal mode

preview_player
Показать описание
This short video demonstrated how to use QFile class read binary file and show in heximal mode on GUI text Edit
The algorithm is each byte the int value is between 0-256, so divide by 16, integer part is displayed at first digit in heximal (0..F), remaining part is displayed at second digit in heximal (0..F), and one space after.
For example for byte value 26, 26/16 integer part is 1 and remaining part is 10 (A), so 26 will be displayed in heximal as 1A.
Рекомендации по теме
Комментарии
Автор

Hi, Hui. memset(hexStr, '\0', sizeof(hexStr) + 1); will set the first character of hexTable to '\0', its a bug found while debugging.

azfalca