<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[有一个函数，返回字符的 ASCII 值吗？ (C++)  相关函数  isalpha，isdigit，islower，isupper ]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 16 Nov 2010 14:31:22 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	我需要一个函数，返回包括空格、 制表符、 换行符等的字符的 ASCII 值...<br/><br/>对类似的注释将转换为十六进制、 十进制，和二进制数字之间的功能是什么？<br/><br/>char c;<br/>int ascii = (int) c;<br/><br/>一个字符 一个的整数转换函数不需要。<br/><br/>也许您正在寻找字符串-使用十六进制、 二进制或十进制表示形式显示整数的函数吗？<br/>--------------------------------------------------------------------------------------------------------------------------------------------<br/>如何编写strcmp函数 返回值为ASCII差值 C语言？？？<br/>测试有效：<br/><br/><br/><div class="code">int MyStrcmp(const char *dst, const char *src)<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;int ch1, ch2;<br/>&nbsp;&nbsp;&nbsp;&nbsp;do<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch1 = (unsigned char)(*(dst++));<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ch2 = (unsigned char)(*(src++)); <br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125; while ( ch1 &amp;&amp; (ch1 == ch2) ); //未结束或相同情况继续循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;return(ch1 - ch2);&nbsp;&nbsp;//返回一个差值 <br/>&#125; <br/><br/>c++怎么输出ascii码对应的字符:<br/>main()<br/>&#123;<br/>&nbsp;&nbsp;for(int i =1;i&lt;128;i++)<br/>&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;i&lt;&lt;&quot;=&quot;&lt;&lt;(char) i&lt;&lt;&quot;&#92;t&quot;;<br/>&nbsp;&nbsp; &#125;<br/>&#125; </div><br/>输出1到127所对应的ascii码字符<br/><div class="code">#include &lt;iostream&gt;;<br/>using namespace std;<br/><br/>int main() <br/>&#123; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;char c;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c = (char)97;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&lt;&lt;c&lt;&lt;endl;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br/>&#125; </div>输出：a<br/><br/>C++中怎样把数字转换成对应的ASCII值？<br/><br/>//字典顺序是按ASCII码值排序的，若想把数字转换为ASCII码，只须+上&#039;0&#039;就可以了，你可以查一下ASCII码字符集（c++教程的附录通常都有这表），就可以很清楚地知道大写字母、小写字母、数字之间转换关系！<br/><br/><br/><div class="code">#include &lt;iostream&gt;<br/>#include &lt;string&gt;<br/>using namespace std;<br/><br/>int main()<br/>&#123;<br/>char* str&#91;5&#93;;<br/><br/>//注：字典顺序是按ASCII码排序的，小写的ASCII码值大于所有大写的ASCII码！<br/>cout&lt;&lt;&quot;请输入五个国家名字(英文):&quot;&lt;&lt;endl;<br/>int i,j,t;<br/>for(i=0;i&lt;5;i++)<br/>&#123;<br/>str&#91;i&#93;=new char&#91;20&#93;;<br/>cin&gt;&gt;str&#91;i&#93;;<br/>&#125;<br/>for(i=0;i&lt;4;i++)<br/>&#123;<br/>t=i;<br/>for(j=i+1;j&lt;5;j++)<br/>&#123;<br/>if(strcmp(str&#91;t&#93;,str&#91;j&#93;)&gt;0)<br/>&#123;<br/>t=j;<br/>&#125;<br/>&#125;<br/>if(t!=i)<br/>&#123;<br/>char temp&#91;20&#93;;<br/>strcpy(temp,str&#91;t&#93;);<br/>strcpy(str&#91;t&#93;,str&#91;i&#93;);<br/>strcpy(str&#91;i&#93;,temp); //交换<br/>&#125;<br/>&#125;<br/><br/>for(i=0;i&lt;5;i++)<br/>&#123;<br/>cout&lt;&lt;str&#91;i&#93;&lt;&lt;&#039;&#92;t&#039;;<br/>&#125;<br/>cout&lt;&lt;endl;<br/>return 0;<br/>&#125;</div><br/><br/>参考：http://www.weste.net/tools/ASCII.asp<br/><br/><br/><br/><br/>isalnum（测试字符是否为英文或数字）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isalpha，isdigit，islower，isupper <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isalnum (int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为英文字母或阿拉伯数字，在标准c中相当于使用“isalpha(c) &#124;&#124; isdigit(c)”做测试。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为字母或数字，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/* 找出str 字符串中为英文字母或数字的字符*/ <br/>#include &lt; ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=”123c@#FDsP[e?”; <br/>int i; <br/>for (i=0;str[i]!=0;i++ ) <br/>if ( isalnum(str[i])) printf(“%c is an alphanumeric character&#92;n”,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;1 is an apphabetic character <br/>2 is an apphabetic character <br/>3 is an apphabetic character <br/>c is an apphabetic character <br/>F is an apphabetic character <br/>D is an apphabetic character <br/>s is an apphabetic character <br/>P is an apphabetic character <br/>e is an apphabetic character <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isalpha （测试字符是否为英文字母）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isalnum，islower，isupper <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isalpha (int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为英文字母，在标准c中相当于使用“isupper(c)&#124;&#124;islower(c)”做测试。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为英文字母，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/* 找出str 字符串中为英文字母的字符*/ <br/>#include &lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=”123c@#FDsP[e?”; <br/>int i; <br/>for (i=0;str[i]!=0;i++) <br/>if(isalpha(str[i])) printf(“%c is an alphanumeric character&#92;n”,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;c is an apphabetic character <br/>F is an apphabetic character <br/>D is an apphabetic character <br/>s is an apphabetic character <br/>P is an apphabetic character <br/>e is an apphabetic character <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isascii（测试字符是否为ASCII 码字符）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;iscntrl <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include &lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isascii(int c); <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为ASCII码字符，也就是判断c的范围是否在0到127之间。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为ASCII码字符，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/* 判断int i是否具有对映的ASCII码字符*/ <br/>#include&lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>int i; <br/>for(i=125;i&lt;130;i++) <br/>if(isascii(i)) <br/>printf(&quot;%d is an ascii character:%c&#92;n&quot;,i,i); <br/>else <br/>printf(&quot;%d is not an ascii character&#92;n&quot;,i); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;125 is an ascii character:&#125; <br/>126 is an ascii character:~ <br/>127 is an ascii character: <br/>128 is not an ascii character <br/>129 is not an ascii character <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>iscntrl（测试字符是否为ASCII 码的控制字符）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isascii <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include &lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int iscntrl(int c)； <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为ASCII控制码，也就是判断c的范围是否在0到30之间。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为ASCII控制码，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isdigit（测试字符是否为阿拉伯数字）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isxdigit <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isdigit(int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为阿拉伯数字0到9。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为阿拉伯数字，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/* 找出str字符串中为阿拉伯数字的字符*/ <br/>#include&lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;123@#FDsP[e?&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(isdigit(str[i])) printf(&quot;%c is an digit character&#92;n&quot;,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;1 is an digit character <br/>2 is an digit character <br/>3 is an digit character <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isgraphis（测试字符是否为可打印字符）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isprint <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include &lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isgraph (int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为可打印字符，若c所对映的ASCII码可打印，且非空格字符则返回TRUE。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为可打印字符，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/* 判断str字符串中哪些为可打印字符*/ <br/>#include&lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;a5 @;&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(isgraph(str[i])) printf(&quot;str[%d] is printable character:%d&#92;n&quot;,i,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;str[0] is printable character:a <br/>str[1] is printable character:5 <br/>str[3] is printable character:@ <br/>str[4] is printable character:; <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>islower（测试字符是否为小写字母）&nbsp;&nbsp;<br/>相关函数&nbsp;&nbsp;isalpha，isupper <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int islower(int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为小写英文字母。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为小写英文字母，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;123@#FDsP[e?&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(islower(str[i])) printf(&quot;%c is a lower-case character&#92;n&quot;,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;c is a lower-case character <br/>s is a lower-case character <br/>e is a lower-case character <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isprint（测试字符是（否为可打印字符）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isgraph <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isprint(int c); <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为可打印字符，若c所对映的ASCII码可打印，其中包含空格字符，则返回TRUE。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为可打印字符，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/* 判断str字符串中哪些为可打印字符包含空格字符*/ <br/>#include&lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;a5 @;&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(isprint(str[i])) printf(&quot;str[%d] is printable character:%d&#92;n&quot;,i,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;str[0] is printable character:a <br/>str[1] is printable character:5 <br/>str[2] is printable character: <br/>str[3] is printable character:@ <br/>str[4] is printable character:; <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isspace（测试字符是否为空格字符）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isgraph <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isspace(int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为空格字符，也就是判断是否为空格(&#039;&#039;)、定位字符(&#039;&#92;t&#039;)、CR(&#039;&#92;r&#039;)、换行(&#039;&#92;n&#039;)、垂直定位字符(&#039;&#92;v&#039;)或翻页(&#039;&#92;f&#039;)的情况。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为空格字符，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/*将字符串str[]中内含的空格字符找出，并显示空格字符的ASCII码*/ <br/>#include &lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str=&quot;123c @# FD&#92;tsP[e?&#92;n&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(isspace(str[i])) <br/>printf(&quot;str[%d] is a white-space character:%d&#92;n&quot;,i,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;str[4] is a white-space character:32 <br/>str[7] is a white-space character:32 <br/>str[10] isa white-space character:9 /* &#92;t */ <br/>str[16] is a white-space character:10 /* &#92;t */ <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>ispunct（测试字符是否为标点符号或特殊符号）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isspace，isdigit，isalpha <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#inlude&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int ispunct(int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为标点符号或特殊符号。返回TRUE也就是代表参数c为非空格、非数字和非英文字母。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;v若参数c为标点符号或特殊符号，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/*列出字符串str中的标点符号或特殊符号*/ <br/>#include &lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;123c@ #FDsP[e?&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(ispunct(str[i])) printf(&quot;%c&#92;n&quot;,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;v <br/>@#[? <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isupper（测试字符是否为大写英文字母）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isalpha，islower <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isupper(int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为大写英文字母。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为大写英文字母，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/*找出字符串str中为大写英文字母的字符*/ <br/>#include &lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;123c@#FDsP[e?&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(isupper(str[i])) printf(&quot;%c is an uppercase character&#92;n&quot;,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;F is an uppercase character <br/>D is an uppercase character <br/>P is an uppercase character <br/>&nbsp;&nbsp;<br/>　&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/> <br/>&nbsp;&nbsp;<br/>isxdigit（测试字符是否为16进制数字）&nbsp;&nbsp; <br/>相关函数&nbsp;&nbsp;isalnum，isdigit <br/>&nbsp;&nbsp;<br/>表头文件&nbsp;&nbsp;#include&lt;ctype.h&gt; <br/>&nbsp;&nbsp;<br/>定义函数&nbsp;&nbsp;int isxdigit (int c) <br/>&nbsp;&nbsp;<br/>函数说明&nbsp;&nbsp;检查参数c是否为16进制数字，只要c为下列其中一个情况则返回TRUE。16进制数字:0123456789ABCDEF。 <br/>&nbsp;&nbsp;<br/>返回值&nbsp;&nbsp;若参数c为16进制数字，则返回TRUE，否则返回NULL(0)。 <br/>&nbsp;&nbsp;<br/>附加说明&nbsp;&nbsp;此为宏定义，非真正函数。 <br/>&nbsp;&nbsp;<br/>范例&nbsp;&nbsp;/*找出字符串str中为十六进制数字的字符*/ <br/>#include &lt;ctype.h&gt; <br/>main() <br/>&#123; <br/>char str[]=&quot;123c@#FDsP[e?&quot;; <br/>int i; <br/>for(i=0;str[i]!=0;i++) <br/>if(isxdigit(str[i])) printf(&quot;%c is a hexadecimal digits&#92;n&quot;,str[i]); <br/>&#125; <br/>&nbsp;&nbsp;<br/>执行&nbsp;&nbsp;1 is a hexadecimal digits <br/>2 is a hexadecimal digits <br/>3 is a hexadecimal digits <br/>c is a hexadecimal digits <br/>F is a hexadecimal digits <br/>D is a hexadecimal digits <br/>e is a hexadecimal digits<br/><br/>来源：http://www.onlyit.cn/topic_list_detail?subject_id=42&amp;topic_id=1005&amp;topic_page_id=13
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 有一个函数，返回字符的 ASCII 值吗？ (C++)  相关函数  isalpha，isdigit，islower，isupper ]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>