Did you try casting ?
Printable View
Did you try casting ?
You shouldn't use str* functions here. Those functions are for strings, and that's not what you're using here. You should keep the length of the array yourself (in an int), and copy using memcpy.
ye now i use memcpy to copy, but im usiing getline to get the data. so i dont know the length.
so how can i get the length? also the send() function for winsock wont take a unsigned char. and if i type cast wont it make all the chars with a value over 127 negative?
If it's binary, don't use getline. Use read instead.