0

I've written a program that outputs text from a file as hex. And this works like a charm. But in the example in the assignment the output starts with:

000000 ......
000010 ......
000020 ......

And that part I haven't figured out how to do! Any pointers? Any links/tutorials I should check out?

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Jaily
0

How is that to vague? In the example output the assignment shows that each "outputed" line starts with the numbers in the original post. (The rest of the lines is in hex)

Now, my program reads the file character by character. My theory is that to get the 000000 I have to read the file line by line. But I'm not sure about this and is therefore wondering if it's an easier way to do it? Can it be done by a for-loop? Something like:

for(int i = 0; i < x; i ++) // x because this will have to change with how many //lines the output requiers
{
cout << "0000" << i << "0" << endl;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.