在C语言中,以下程序是%5 %%,但我不知道如何?
printf("%6%5%%%78%");
Run Code Online (Sandbox Code Playgroud)
这是未定义的行为,并且是特定于编译器/平台的.具有错误参数的Printf函数将开始从堆栈中转换变量,然后任何事情都可能发生.
这就是为什么编译器通常会抱怨这一点
source.c:5:5: warning: conversion lacks type at end of format [-Wformat]
source.c:5:5: warning: conversion lacks type at end of format [-Wformat]
source.c:5:5: warning: conversion lacks type at end of format [-Wformat]
source.c:5:5: warning: spurious trailing '%' in format [-Wformat]
Run Code Online (Sandbox Code Playgroud)