invalid types `unsigned char[int]' for array subscript

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top