T
tech
Hi, I want to dump 1500 bytes at a time to a file as part of the
logger i am writing for my driver.
However i want to the bytes to appear as text but as hex value not
characters.
I also need to separate each block of 1500 bytes by a new line and a
sequence number which identifies each block.
The following sample code gives me text output
static std:fstream FileOutput("data.out",std::ios:ut);
static std:stringstream os;
unsigned char Data[1500];
os << SeqNo << std::endl;
for (int i = 0; i < BufferLength; ++i)
{
os << Data ;
}
os << std::endl;
How do i format Data to appear as hex values
Fileoutput << os.str();
logger i am writing for my driver.
However i want to the bytes to appear as text but as hex value not
characters.
I also need to separate each block of 1500 bytes by a new line and a
sequence number which identifies each block.
The following sample code gives me text output
static std:fstream FileOutput("data.out",std::ios:ut);
static std:stringstream os;
unsigned char Data[1500];
os << SeqNo << std::endl;
for (int i = 0; i < BufferLength; ++i)
{
os << Data ;
}
os << std::endl;
How do i format Data to appear as hex values
Fileoutput << os.str();