Should I be using a char array?

For reading in four bytes at a time, modifying them and outputing them untill bytes<=3 ?
I want to manipulate the data in hex.
What should I be using?
Last edited on
A char variable holds one byte of memory.
An int hold 4 bytes.
I know how much they hold. I want to read in from a file 4 bytes and alter their values and then write them back out to another file in hex untill bytes <4 would that work with an array?
Last edited on
I think it depends on how you are going to manipulate the values, what is more easy to handle.

If you decide not to use a char array you might want to use a fixed length type like std::unit32_t from <cstdint> because int is not 4 bytes everywhere.
Last edited on
Topic archived. No new replies allowed.