<分区>
Possible Duplicate:
How should I print types like off_t and size_t?
我正在使用 fstat(stream, &fs)
在 C 中获取文件大小,返回类型 off_t
。
打印这个只是给出一个警告:
format ‘%d’ expects type ‘int’, but argument has type ‘off_t’
关于如何在没有编译器错误的情况下打印它有什么想法吗?
<分区>
Possible Duplicate:
How should I print types like off_t and size_t?
我正在使用 fstat(stream, &fs)
在 C 中获取文件大小,返回类型 off_t
。
打印这个只是给出一个警告:
format ‘%d’ expects type ‘int’, but argument has type ‘off_t’
关于如何在没有编译器错误的情况下打印它有什么想法吗?
最佳答案
偏移类型通常是长整数。类型转换它,并相应地打印它。
off_t 下面的实际类型在 sys/types.h 中定义。你可以查一下!
关于c - 如何在 C 中打印 'off_t'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5251669/