Why is parameter to isdigit integer?

后端 未结 2 1446
南旧
南旧 2021-01-15 03:51

The function std::isdigit is:

  int isdigit(int ch);

The return (Non-zero value if the character is a numeric character, zero otherwise.) s

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-15 04:16

    The reaons is to allow EOF as input. And EOF is (from here):

    EOF integer constant expression of type int and negative value

提交回复
热议问题