U
uche
Please give me some feed back on this issue:
Here is the complier error:
hexdmp.cpp: In function `void output(unsigned char, int, bool&)':
hexdmp.cpp:133: error: invalid types `unsigned char[int]' for array
subscript
hexdmp.cpp:146: error: invalid types `unsigned char[int]' for array
subscript
hexdmp.cpp:146: error: invalid types `unsigned char[int]' for array
subscript
hexdmp.cpp:149: error: invalid types `unsigned char[int]' for array
subscript
Here is the code:
while (!endoffile)
{
cout<<setw(4)<<setfill('0')<<uppercase<<hex<<addr<<"0: ";
for (int index = 0; index <16; index++)
{
index2++;
if (index2 <= curr_buffer_size)
cout<<hex<<setw(2)<<setfill('0')<<(int)ret_buffer[index];
else
cout<<" ";
cout<<" ";
}//end for
cout<<setfill(' ');
//cout<< " ");
index2 = 0;
for (int index = 0; index < 16; index ++)
{
index2++;
if (index2 <= index)
{
if (ret_buffer[index] < 32 || ret_buffer[index] > 126)
printf('.');
else
cout<<ret_buffer[index];
}//end if
}//end for
Here is the complier error:
hexdmp.cpp: In function `void output(unsigned char, int, bool&)':
hexdmp.cpp:133: error: invalid types `unsigned char[int]' for array
subscript
hexdmp.cpp:146: error: invalid types `unsigned char[int]' for array
subscript
hexdmp.cpp:146: error: invalid types `unsigned char[int]' for array
subscript
hexdmp.cpp:149: error: invalid types `unsigned char[int]' for array
subscript
Here is the code:
while (!endoffile)
{
cout<<setw(4)<<setfill('0')<<uppercase<<hex<<addr<<"0: ";
for (int index = 0; index <16; index++)
{
index2++;
if (index2 <= curr_buffer_size)
cout<<hex<<setw(2)<<setfill('0')<<(int)ret_buffer[index];
else
cout<<" ";
cout<<" ";
}//end for
cout<<setfill(' ');
//cout<< " ");
index2 = 0;
for (int index = 0; index < 16; index ++)
{
index2++;
if (index2 <= index)
{
if (ret_buffer[index] < 32 || ret_buffer[index] > 126)
printf('.');
else
cout<<ret_buffer[index];
}//end if
}//end for