python - Python 代码 struct.pack 的 C 等效项?

标签 python c

Possible Duplicate:
What is the C Equivalent of Python's pack(“<I”, 0)

如何在 Python 中复制代码:

from struct import pack
string = pack("<I", 0x11111111)
print string

用C语言?据我了解\x11 是一个不可打印的字符,所以...?

最佳答案

const char *string = "\x11\x11\x11\x11";
puts(string);

关于python - Python 代码 struct.pack 的 C 等效项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10777831/

相关文章:

python - 无法在python中运行turtle类

python - Content-Type in 用于 python 请求中的单个文件

c - 用C中的另一个字符串替换字符串中的char

python - matplotlib 中的自定义连续颜色图

python - 如何将列表添加到一起

java - 编译器如何区分从不同实例化创建的相同变量

C 编程温度转换

c++ - 操作系统和编译器如何通信以启动程序编译

c - 在 C 程序中,BITWISE AND 运算怎么可能比 ARITHMETIC ADDITION 运算占用更多的 CPU 时钟?

c++ - 许多 linux 套接字后服务器卡住