> MakePacket(LCP,REQ,number,"\x0E\x02\x06\x00\x0A\x00\x00\x07\x02\x08\x02"); Each of these escape sequences compiles to a single char of the specified hex value, so "\x00" compiles to binary 0, but zero is string terminator and can't be contained within a string. If the compiler let it go, MakePacket would fail because it would see the first \x00 as the end of the string. You need something like: const unsigned char IPhack[] = { 0x0e, 0x02, 0x06, 0x00, 0x0a ... }; and add packet length param to MakePacket e.g. MakePacket(LCP,REQ,number,IPhack,sizeof(IPhack));