Bhu*_*bus 2 c python null string-formatting
当我编写并运行语句时:
print "\x00\x00\x00"
Run Code Online (Sandbox Code Playgroud)
在Python中,它输出三个空格,后跟换行符.但是在C中,当我编写并运行语句时:
char hex[] = "\x00\x00\x00";
printf("%s\n", hex);
Run Code Online (Sandbox Code Playgroud)
它像我想的那样解释NULL字节:它没有做任何事情.那么为什么在Python中将NULL字节视为空格?...