printf() with no arguments in C compiles fine. how?

前端 未结 10 1951
后悔当初
后悔当初 2020-12-02 00:10

I tried the below c program & I expected to get compile time error, but why compiler isn\'t giving any error?

#include 
int main(void)
{
          


        
10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 00:53

    According to this documentation, the additional arguments must be at least as many as the format specifiers in the first argument. This seems to be undefined behaviour.

提交回复
热议问题