Search code examples
cbinary-datadata-representation

what is binary data?


gcc 4.6.0

What does binary data look like? Is it all 1's and 0's.

I was just wondering, as I was talking to another programmer about copying strings and binary data.

Normally, I use strcpy/strncpy functions to copy strings and memcpy/memmove to copy binary data. However, I am just wondering what does it looks like?

Many thanks for any suggestions,


Solution

  • In this context, "binary data" is typically just data which could contain null bytes (e.g, '\0'). String manipulation functions like strcpy() and strncpy() will stop when they see these characters, whereas byte manipulation functions like memcpy() and memmove() will always continue for the number of bytes you tell them to.