>Some thing like this?
Yes. To do the read, you have three different options depending on what in the file you want to print in hex. Firstly, if you want don't want whitespace as part of the hex dump, you can use:

Code:

inData >> ...............

Secondly, if you do want spaces to be part of the hex dump, you can use getline

Code:

char line[200];
inData.getline(line, sizeof(line));

Thirdly, if you want whitespace and newlines as part of the hex dump, use read, as you've posted.

10-04-2006

Salem

> Some thing like this?
Yeah "something" like that.
Did you compile it?

First immediately obvious problem is lower() and upper() are declared inside main(). C++ doesn't have nested functions like say Pascal.

Try it with a small buffer first, say
char buffer[] = "hello world";

before getting all messy and reading it from a file.

10-04-2006

Kdar

Quote:

Originally Posted by Salem

> Some thing like this?
Yeah "something" like that.
Did you compile it?

First immediately obvious problem is lower() and upper() are declared inside main(). C++ doesn't have nested functions like say Pascal.