ctype.h头文件中的tolower和toupper以及cctype其他函数的应用

最好不要用cctype,直接,ACM中提供的编译器版本有的较低不支持cctype。


#include 
#include 
using namespace std;
int main(){
	char a = 't';
	char b = 'T';
	printf("%c---%c\n", toupper(a), tolower(b));
}


以下转自:http://blog.csdn.net/liuchuo/article/details/54602567


isalpha、islower、isupper、isalnum、isblank、isspace这些函数都在的头文件里面,下图是它们所表示的范围:

ctype.h头文件中的tolower和toupper以及cctype其他函数的应用_第1张图片


总的来说就是:

isalpha 字母(包括大写、小写)islower(小写字母)isupper(大写字母)isalnum(字母大写小写+数字)isblank(space和\t)isspace(space、\t、\r、\n)


你可能感兴趣的:(STL函数库)