How # flag in printf works?

后端 未结 3 593
囚心锁ツ
囚心锁ツ 2021-01-28 16:03
#include 
int main()
{
  float x;
  x=(int)(float)(double)(5.5);
  printf(\"%#u\",x);
  return 0;
}

How the # flag in the p

3条回答
  •  盖世英雄少女心
    2021-01-28 16:13

    From the manual page:

    #

    The value should be converted to an "alternate form" [...] For other conversions, the result is undefined.

    So yes, it's undefined.

提交回复
热议问题