C++ Reference: Standard C++ Library reference: C Library: cwctype: iswdigit
创始人
2024-02-22 05:19:11
0

C++官网参考链接:https://cplusplus.com/reference/cwctype/iswdigit/

函数

iswdigit
int iswdigit (wint_t c);
检查宽字符是否为十进制数字
检查c是否为十进制数字字符。
十进制数字是0 1 2 3 4 5 6 7 8 9中的任意一个。
此函数是isdigit()的宽字符等效形式:如果c与wctob一起转换为isdigit为真的字符,则此函数也始终将其视为十进制数字字符。
在C++中,对于所有字符类型,此函数(isdigit)的特定于区域设置的模板版本存在于头文件中。

形参 
c
要检查的宽字符,转换为一个wint_t或WEOF。
wint_t是一个整型类型。

返回值
如果c确实是一个十进制数字,则不同于零(即true)的值。否则为零(即为false)。

用例
/* iswdigit example */
#include
#include
#include
int main ()
{
  wchar_t str[] = L"1776ad";
  long int year;
  if (iswdigit(str[0]))
  {
    year = wcstol (str,NULL,10);
    wprintf (L"The year that followed %ld was %ld.\n",year,year+1);
  }
  return 0;
}
输出:

另请参考
isdigit    Check if character is decimal digit (function)
iswxdigit    Check if wide character is hexadecimal digit (function)
iswalnum    Check if wide character is alphanumeric (function)
iswalpha    Check if wide character is alphabetic (function)
isdigit (locale)    Check if character is a decimal digit using locale (function template) 

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
有效的括号 一、题目 给定一个只包括 '(',')','{','}'...
【Ctfer训练计划】——(三... 作者名:Demo不是emo  主页面链接:主页传送门 创作初心ÿ...