串和字符串函数

  <!-- @page { margin: 2cm } P { margin-bottom: 0.21cm } -->

串和字符串

1.isalnum

#include<ctype.h>

int isalnum(int ch);

函数是判断字符是否是字母或数字。若是,返回非 0值。否则返回 0;


2。 isalpha

#include<ctype.h>

int isalpha(int ch);

函数是判断字符是否是字母。若是,则返回非 0;否则返回 0;


3。 isblank

#include<ctype.h>

int isblack(int ch)


4.isdigit

#include<ctype.h>

int isdigit(int ch);

ch为数字时( 0-- 9),函数返回非 0值


5.islower

#include<ctype.h>

int islower(int ch);

如果 ch为小写字母,函数返回非 0值。



6.ispunct

#include<ctype.h>

int ispunct(int ch)

如果 ch是标点符号,函数返回非 0值。


7.isspace

#include<ctype.h>

int isspace(int ch);

ch为空白字符,包括空格/水平制表符/垂直制表符/换页/回车/新行符时,函数返回于非 0。


8.isupper

#include<ctype.h>

int isupper(int ch);

如果 ch是大写字母,函数返回非 0值


9.memchr

#include<string.h>

void *memchr(const void *buf,int ch,size_t count);

buf前 count返回首次出现 ch的地址;若未找到,返回空指针。



10.memcpy

#include<string.h>

int memcmp(const void *buf1,const void *buf2,size_t count);

函数比较 buf1和 buf2指向的数组的前 count个字节。结果为 buf1- buf2


11 memcpy

#include<string.h>

void *memcpy(void *to ,const void *from,size_t count);

函数将从 from指向的数组向 to指向的数组复制 count个字符。


12.memmove

#include<string.h>

void *memmove(void *to,const void *from,size_t count);

功能和 memcpy。只是当 to和 from同地址时仍执行。


13.memset

#include<string.h>

void *memset(void *buf,int ch,size_t count);


14.strcat

追加


15.strchr

#include<string.h>

char *strchr(const char *str,int ch);

返回 str中第一次出现 ch的地址。若没有,返回空指针


16.strcmp

#include<string.h>

int strcmp(const char *str1,const char str2);

函数返回 str1- str2


17.strcpy

#include<string.h>

char *(char *str1,const char *str2);


18.strlen

#include<string.h>

size_t strlen(const char *str);


19.strncat

#include<string.h>

char *strncat(char *str1,const char *str2,size_t count);

str2前 count字节追加到 str1



20.strncmp

#include<string.h>

int strncmp(const char *str1,const char *str2,size_t count)

比较前 count字节。 str1- str2


21.strncpy

#include<string.h>

char *strncpy(char *str1,const char *str2,size_t count);

复制前 count字节


22.tolower

#include,ctype.h>

int tolower(int ch);

返回小写。 Ch值不变


23.toupper

#include<ctype.h>

int toupper(int ch);

返回大写。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值