I have a unsigned char
array like this:
unsigned char myArr[] = {100, 128, 0, 32, 2, 9};
I am using reinterpret_cast
to covert it to const char*
as I have to pass a const char*
to a method. This information is then sent over grpc and the other application (erlang based recieves it and stores it in a erlang Bin). But what I observe is the Erlang application only received <<100, 128>> and nothing after that. What could be causing this? Is it the 0
in the character array that is the problem here? Could someone explain how to handle the 0
in an unsigned char
array? I did read quite a few answers but nothing clearly explains my problem.