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) 

相关内容

热门资讯

【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
牛客计算器的改良(Python... 文章目录1.题目描述2.输入描述:3.输出描述:4.示例15.分析6.代码7.结语 链接࿱...
【前端】‘??‘与‘||‘有什... 0 问题 经常写const data = res.data.a ?? ''或者const d...
正大杯|市调大赛|2023备赛... 关键信息 同时随着精细化养宠趋势的深入,宠物消费类目日渐丰富。 本报告通过 Niuco...
文本生成视频Make-A-Vi... Meta公司(原Facebook)在今年9月29日首次推出一款人工智能系...