c语言中isdigit函数
In this article, we’ll take a look at using the isdigit() function in C/C++. This is a very simple way to check if any value is a digit or not. Let’s look at how to use this function, using some simple examples.
在本文中,我们将研究在C / C ++中使用isdigit()函数。 这是检查任何值是否为数字的非常简单的方法。 让我们通过一些简单的示例来看看如何使用此功能。
C / C ++中isdigit()的基本语法 (Basic Syntax of isdigit() in C/C++)
This function takes a characer value val
and returns 0 or 1, if the value is a numerical digit.
此函数采用字符值val
,如果该值是数字,则返回0或1。
This is defined in the <ctypes.h>
header file, so we must also include this file.