I'm trying to build my first client/server apps and to exchange data between them using sockets.
When I try to send "%" character for example or "_", I'm getting on the other side a "\\0".
How to send special characters using tcp/ip sockets in C++ ?
Thank you so much!
The problem is, that "%" is a string and not a character. In C/C++, this means that you're silently also getting a string termination. Try using '%'.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.