D
darren
Hi there
Im working on an assignment that has me store data in a buffer to be
sent over the network. I'm ignorant about how C++ stores data in an
array, and types in general.
If i declare an array of chars that is say 10 bytes long:
char buff[10];
does this mean that i can safely store 80 bits of data?
When i think of an array of chars, i think each spot in the array as a
sequence of 8 1's or 0's. Is this a correct visualization? I guess
my question here is why do most buffers seem to be implemented as char
arrays? Can any binary value between 0 and 255 be safely put into a
char array slot (00000000 to 11111111). Why not implement a buffer
using uint8_t ?
Obviously I have a very loose grasp on how buffers are saving data,
and how a receiver gets this data on their end. I understand the
sockets stuff, just not the buffer-specific stuff. Any enlightenment
would be most appreciated.
thanks.
Im working on an assignment that has me store data in a buffer to be
sent over the network. I'm ignorant about how C++ stores data in an
array, and types in general.
If i declare an array of chars that is say 10 bytes long:
char buff[10];
does this mean that i can safely store 80 bits of data?
When i think of an array of chars, i think each spot in the array as a
sequence of 8 1's or 0's. Is this a correct visualization? I guess
my question here is why do most buffers seem to be implemented as char
arrays? Can any binary value between 0 and 255 be safely put into a
char array slot (00000000 to 11111111). Why not implement a buffer
using uint8_t ?
Obviously I have a very loose grasp on how buffers are saving data,
and how a receiver gets this data on their end. I understand the
sockets stuff, just not the buffer-specific stuff. Any enlightenment
would be most appreciated.
thanks.