2018年6月29日 星期五

str...

strcat 此函式用來連接兩字串合併成單一字串
 char str[80];
  strcpy (str,"these ");
  strcat (str,"strings ")
//以下為原始碼
char *
strcat(char * __restrict s, const char * __restrict append)
{
    char *save = s;
 
    for (; *s; ++s);
    while ((*s++ = *append++));
    return(save);
}
strcmp 用來比較兩字串是否相同,相同回傳 0,不相同則回傳兩字串 ASCII 相減的值
strncat 用來串接指定多少字元
strncmp比較字串前兩個字元是否相同,如果相同則印出
strstr(s1, s2)傳回 s2 字串在 s1字串中第一次出現的位置
strlen(s1)傳回 s1 的長度(不含 '\0' 字元)
strrev(s1)將 s1 字串倒置

沒有留言:

張貼留言

Ethereum- Learn Solidity step by step

Common Function Types: public: Anyone can call this function,but it isn't really used for any type of security per se. priv...