c - 如何在 C 中不使用 printf 打印 LLONG_MIN?

标签 c printing

<分区>

我声明了一个 long long 类型的变量,并为其分配了 LLONG_MIN,但我不允许这样做。

ft_long_long_to_ascii_base.c:23:14: error: integer constant is so large that it is unsigned [-Werror]

if (val == -9223372036854775808)

最佳答案

与其猜测 LLONG_MIN 可能是什么,不如使用提供的宏

#include <stdint.h>
if (val == LLONG_MIN)

关于c - 如何在 C 中不使用 printf 打印 LLONG_MIN?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34095251/

相关文章:

c++ - 将通用文件包含在一个头文件中有什么好处?

Python -> 告诉一个带有 print 语句的程序到 "not print"

javascript - 使用 JavaScript 函数打印时如何打印隐藏的 DIV

c - Valgrind : Invalid read/write of size 1 Ask

c - 链接到另一个共享对象的共享对象

c++ - SDL_GetKeyboardState 不返回按键的当前状态

c - 使用 valgrind 和 gprof 分析 intel mkl 函数

ios - 如何在 iOS 4.2 中打印图像?

javascript - 当打印页面从顶部 html 给出 div 边距时

android - 适用于 Android 的蓝牙和 WIFI 打印