函数(function):①完成独立特定任务程序代码;②语法规则定义了函数的结构和使用方式。
为什么使用函数:①省去编写重复代码时间;②可以让程序更加模块化,提升代码的可读性;③方便后期的修改与完善。
ascil码的输出:
#include <stdio.h>;
int main{
int i;
for (i=0;i<127;i++)
{
printf("%c,",i);
}
return 0;
}
头文件为:<ctype.h>;
返回值0是表示假,非0为真;
printf("%d\n",isupper('a')); 是否为大写字母
printf("%d\n",islower('a')); 是否为小写字母
printf("%d\n",isalpha('97')); 是否为字母
printf("%d\n",isdigit('50')); 是否位数字
printf("大写:%c\n",toupper('a')); 是否对应大写字母
printf("小写:%c\n",tolower('A')); 是否对应小写字母