Hello, I am in a C+ programming class at my college where I am at, and for one fo my labs I have to create a program similar to hexdump of linux, I can do everything it asks me to do, but I can't figure out how to do the input buffer, can somebody send me a code that would make the program read a file 16 bytes at a time. And oculd you please send it to edited by moderator Thanks in advance.
jifiii
0
Light Poster
Recommended Answers
Jump to PostWe don't write your code for you-- we're here to help you learn.
Please at least attempt to write something, and meanwhile, we might be able to give you some pointers. Also, posting your email address for us to send you the output is also counterproductive to the goal …
Jump to Post>how can I fix it to where it reads 16 bytes at a time.
Without looking at the code:char buffer[17]; ... fgets ( buffer, sizeof buffer, in );
Jump to PostYour code tries to read 16 chars from the console, but you say you need to be reading from a file. As Naru points out, you can use fgets, or you can use fgetc() or something similar.
int count = 0;
int c;
while ((count < 16 && ((c …
All 9 Replies
alc6379
120
Cookie... That's it
Team Colleague
jifiii
0
Light Poster
Dave Sinkula
commented:
Show your attempt first. And use code tags.
+0
jifiii
0
Light Poster
Narue
5,707
Bad Cop
Team Colleague
jifiii
0
Light Poster
Chainsaw
12
Posting Pro in Training
Narue
5,707
Bad Cop
Team Colleague
jifiii
0
Light Poster
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.