Wrong number of parameters to printf leads to strange results

后端 未结 4 1717
臣服心动
臣服心动 2021-01-27 01:26
#include 

int main() {
   int i=10,j=20;
   printf(\"%d%d%d\",i,j);
   printf(\"%d\",i,j); 
   return 0;
}

Using the Turbo C compiler,

4条回答
  •  孤街浪徒
    2021-01-27 02:03

    The behavior is undefined, meaning the language spec doesn't say what happens in this case. It depends entirely on the implementation of the compiler and on your system architecture. Explaining undefined behavior can be occasionally entertaining, often maddening, and pretty much always useless -- so don't worry about it!

提交回复
热议问题