亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? standard.shar

?? c語言開發(fā)方面的經(jīng)典問題,包括源代碼.c語言開發(fā)所要注意的問題,以及在嵌入式等各方面的應(yīng)用
?? SHAR
?? 第 1 頁 / 共 5 頁
字號(hào):
X    int len1, len2;XX    if (s1 == NULL || s2 == NULL) {X        Error("NULL string passed to Concat");X    }X    len1 = strlen(s1);X    len2 = strlen(s2);X    s = CreateString(len1 + len2);X    strcpy(s, s1);X    strcpy(s + len1, s2);X    return (s);X}XXchar IthChar(string s, int i)X{X    int len;XX    if (s == NULL) Error("NULL string passed to IthChar");X    len = strlen(s);X    if (i < 0 || i > len) {X        Error("Index outside of string range in IthChar");X    }X    return (s[i]);X}XXstring SubString(string s, int p1, int p2)X{X    int len;X    string result;XX    if (s == NULL) Error("NULL string passed to SubString");X    len = strlen(s);X    if (p1 < 0) p1 = 0;X    if (p2 >= len) p2 = len - 1;X    len = p2 - p1 + 1;X    if (len < 0) len = 0;X    result = CreateString(len);X    strncpy(result, s + p1, len);X    result[len] = '\0';X    return (result);X}XXstring CharToString(char ch)X{X    string result;XX    result = CreateString(1);X    result[0] = ch;X    result[1] = '\0';X    return (result);X}XXint StringLength(string s)X{X    if (s == NULL) Error("NULL string passed to StringLength");X    return (strlen(s));X}XXstring CopyString(string s)X{X    string newstr;XX    if (s == NULL) Error("NULL string passed to CopyString");X    newstr = CreateString(strlen(s));X    strcpy(newstr, s);X    return (newstr);X}XX/* Section 2 -- String comparison functions */XXbool StringEqual(string s1, string s2)X{X    if (s1 == NULL || s2 == NULL) {X        Error("NULL string passed to StringEqual");X    }X    return (strcmp(s1, s2) == 0);X}XXint StringCompare(string s1, string s2)X{X    if (s1 == NULL || s2 == NULL) {X        Error("NULL string passed to StringCompare");X    }X    return (strcmp(s1, s2));X}XX/* Section 3 -- Search functions */XXint FindChar(char ch, string text, int start)X{X    char *cptr;XX    if (text == NULL) Error("NULL string passed to FindChar");X    if (start < 0) start = 0;X    if (start > strlen(text)) return (-1);X    cptr = strchr(text + start, ch);X    if (cptr == NULL) return (-1);X    return ((int) (cptr - text));X}XXint FindString(string str, string text, int start)X{X    char *cptr;XX    if (str == NULL) Error("NULL pattern string in FindString");X    if (text == NULL) Error("NULL text string in FindString");X    if (start < 0) start = 0;X    if (start > strlen(text)) return (-1);X    cptr = strstr(text + start, str);X    if (cptr == NULL) return (-1);X    return ((int) (cptr - text));X}XX/* Section 4 -- Case-conversion functions */XXstring ConvertToLowerCase(string s)X{X    string result;X    int i;XX    if (s == NULL) {X        Error("NULL string passed to ConvertToLowerCase");X    }X    result = CreateString(strlen(s));X    for (i = 0; s[i] != '\0'; i++) result[i] = tolower(s[i]);X    result[i] = '\0';X    return (result);X}XXstring ConvertToUpperCase(string s)X{X    string result;X    int i;XX    if (s == NULL) {X        Error("NULL string passed to ConvertToUpperCase");X    }X    result = CreateString(strlen(s));X    for (i = 0; s[i] != '\0'; i++) result[i] = toupper(s[i]);X    result[i] = '\0';X    return (result);X}XX/* Section 5 -- Functions for converting numbers to strings */XXstring IntegerToString(int n)X{X    char buffer[MaxDigits];XX    sprintf(buffer, "%d", n);X    return (CopyString(buffer));X}XXint StringToInteger(string s)X{X    int result;X    char dummy;XX    if (s == NULL) {X        Error("NULL string passed to StringToInteger");X    }X    if (sscanf(s, " %d %c", &result, &dummy) != 1) {X        Error("StringToInteger called on illegal number %s", s);X    }X    return (result);X}XXstring RealToString(double d)X{X    char buffer[MaxDigits];XX    sprintf(buffer, "%G", d);X    return (CopyString(buffer));X}XXdouble StringToReal(string s)X{X    double result;X    char dummy;XX    if (s == NULL) Error("NULL string passed to StringToReal");X    if (sscanf(s, " %lg %c", &result, &dummy) != 1) {X        Error("StringToReal called on illegal number %s", s);X    }X    return (result);X}XX/* Private functions */XX/*X * Function: CreateStringX * Usage: s = CreateString(len);X * -----------------------------X * This function dynamically allocates space for a string ofX * len characters, leaving room for the null character at theX * end.X */XXstatic string CreateString(int len)X{X    return ((string) GetBlock(len + 1));X}END_OF_FILEif test 5382 -ne `wc -c <'cslib/strlib.c'`; then    echo shar: \"'cslib/strlib.c'\" unpacked with wrong size!fi# end of 'cslib/strlib.c'fiif test -f 'cslib/strlib.h' -a "${1}" != "-c" ; then   echo shar: Will not clobber existing file \"'cslib/strlib.h'\"elseecho shar: Extracting \"'cslib/strlib.h'\" \(7407 characters\)sed "s/^X//" >'cslib/strlib.h' <<'END_OF_FILE'X/*X * File: strlib.hX * Version: 1.0X * Last modified on Fri Jul 15 14:10:40 1994 by erobertsX * -----------------------------------------------------X * The strlib.h file defines the interface for a simpleX * string library.  In the context of this package, stringsX * are considered to be an abstract data type, which meansX * that the client relies only on the operations defined forX * the type and not on the underlying representation.X */XX/*X * Cautionary note:X * ----------------X * Although this interface provides an extremely convenientX * abstraction for working with strings, it is not appropriateX * for all applications.  In this interface, the functions thatX * return string values (such as Concat and SubString) do soX * by allocating new memory.  Over time, a program that usesX * this package will consume increasing amounts of memoryX * and eventually exhaust the available supply.  If you areX * writing a program that runs for a short time and stops,X * the fact that the package consumes memory is not a problem.X * If, however, you are writing an application that must runX * for an extended period of time, using this package requiresX * that you make some provision for freeing any allocatedX * storage.X */XX#ifndef _strlib_hX#define _strlib_hXX#include "genlib.h"XX/* Section 1 -- Basic string operations */XX/*X * Function: ConcatX * Usage: s = Concat(s1, s2);X * --------------------------X * This function concatenates two strings by joining them endX * to end.  For example, Concat("ABC", "DE") returns the stringX * "ABCDE".X */XXstring Concat(string s1, string s2);XX/*X * Function: IthCharX * Usage: ch = IthChar(s, i);X * --------------------------X * This function returns the character at position i in theX * string s.  It is included in the library to make the typeX * string a true abstract type in the sense that all of theX * necessary operations can be invoked using functions. CallingX * IthChar(s, i) is like selecting s[i], except that IthCharX * checks to see if i is within the range of legal indexX * positions, which extend from 0 to StringLength(s).X * IthChar(s, StringLength(s)) returns the null characterX * at the end of the string.X */XXchar IthChar(string s, int i);XX/*X * Function: SubStringX * Usage: t = SubString(s, p1, p2);X * --------------------------------X * SubString returns a copy of the substring of s consistingX * of the characters between index positions p1 and p2,X * inclusive.  The following special cases apply:X *X * 1. If p1 is less than 0, it is assumed to be 0.X * 2. If p2 is greater than the index of the last stringX *    position, which is StringLength(s) - 1, then p2 isX *    set equal to StringLength(s) - 1.X * 3. If p2 < p1, SubString returns the empty string.X */XXstring SubString(string s, int p1, int p2);XX/*X * Function: CharToStringX * Usage: s = CharToString(ch);X * ----------------------------X * This function takes a single character and returns aX * one-character string consisting of that character.  TheX * CharToString function is useful, for example, if youX * need to concatenate a string and a character.  SinceX * Concat requires two strings, you must first convertX * the character into a string.X */XXstring CharToString(char ch);XX/*X * Function: StringLengthX * Usage: len = StringLength(s);X * -----------------------------X * This function returns the length of s.X */XXint StringLength(string s);XX/*X * Function: CopyStringX * Usage: newstr = CopyString(s);X * ------------------------------X * CopyString copies the string s into dynamically allocatedX * storage and returns the new string.  This function is notX * ordinarily required if this package is used on its own,X * but is often necessary when you are working with more thanX * one string package.X */XXstring CopyString(string s);XX/* Section 2 -- String comparison functions */XX/*X * Function: StringEqualX * Usage: if (StringEqual(s1, s2)) ...X * -----------------------------------X * This function returns TRUE if the strings s1 and s2 areX * equal.  For the strings to be considered equal, everyX * character in one string must precisely match theX * corresponding character in the other.  Uppercase andX * lowercase characters are considered to be different.X */XXbool StringEqual(string s1, string s2);XX/*X * Function: StringCompareX * Usage: if (StringCompare(s1, s2) < 0) ...X * -----------------------------------------X * This function returns a number less than 0 if string s1X * comes before s2 in alphabetical order, 0 if they are equal,X * and a number greater than 0 if s1 comes after s2.  TheX * ordering is determined by the internal representation usedX * for characters, which is usually ASCII.X */XXint StringCompare(string s1, string s2);XX/* Section 3 -- Search functions */XX/*X * Function: FindCharX * Usage: p = FindChar(ch, text, start);X * -------------------------------------X * Beginning at position start in the string text, thisX * function searches for the character ch and returns theX * first index at which it appears or -1 if no match isX * found.X */XXint FindChar(char ch, string text, int start);XX/*X * Function: FindStringX * Usage: p = FindString(str, text, start);X * ----------------------------------------X * Beginning at position start in the string text, thisX * function searches for the string str and returns theX * first index at which it appears or -1 if no match isX * found.X */XXint FindString(string str, string text, int start);XX/* Section 4 -- Case-conversion functions */XX/*X * Function: ConvertToLowerCaseX * Usage: s = ConvertToLowerCase(s);X * ---------------------------------X * This function returns a new string with allX * alphabetic characters converted to lower case.X */XXstring ConvertToLowerCase(string s);XX/*X * Function: ConvertToUpperCaseX * Usage: s = ConvertToUpperCase(s);X * ---------------------------------X * This function returns a new string with allX * alphabetic characters converted to upper case.X */XXstring ConvertToUpperCase(string s);XX/* Section 5 -- Functions for converting numbers to strings */XX/*X * Function: IntegerToStringX * Usage: s = IntegerToString(n);X * ------------------------------X * This function converts an integer into the correspondingX * string of digits.  For example, IntegerToString(123)X * returns "123" as a string.X */XXstring IntegerToString(int n);XX/*X * Function: StringToIntegerX * Usage: n = StringToInteger(s);X * ------------------------------X * This function converts a string of digits into an integer.X * If the string is not a legal integer or contains extraneousX * characters, StringToInteger signals an error condition.X */XXint StringToInteger(string s);XX/*X * Function: RealToStringX * Usage: s = RealToString(d);X * ---------------------------X * This function converts a floating-point number into theX * corresponding string form.  For example, callingX * RealToString(23.45) returns "23.45".  The conversion isX * the same as that used for "%G" format in printf.X */XXstring RealToString(double d);XX/*X * Function: StringToRealX * Usage: d = StringToReal(s);X * ---------------------------X * This function converts a string representing a real numberX * into its corresponding value.  If the string is not aX * legal floating-point number

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人伦理片在线| 欧美日韩综合色| 精品婷婷伊人一区三区三| 久久综合一区二区| 麻豆久久久久久久| 欧美久久久久久久久久| 国产精品国产三级国产aⅴ中文 | 波多野结衣在线一区| 欧美一区二区三区视频在线| 国产精品不卡视频| 国产精品1区2区3区在线观看| 欧美日韩精品免费观看视频| 亚洲乱码一区二区三区在线观看| 国产乱色国产精品免费视频| 欧美一级搡bbbb搡bbbb| 欧美在线播放高清精品| av成人老司机| 日韩欧美国产电影| 日韩精品成人一区二区三区| 久久精品夜夜夜夜久久| 亚洲制服欧美中文字幕中文字幕| 成人黄色在线网站| 欧美国产激情一区二区三区蜜月| 九色综合狠狠综合久久| 欧美一区二区三区系列电影| 亚洲国产精品久久久久婷婷884| 91理论电影在线观看| 国产亚洲欧美在线| 国产精品一二二区| 精品国产乱码久久久久久影片| 日韩国产欧美在线观看| 91精品国产综合久久精品app | 久久青草国产手机看片福利盒子| 蜜臂av日日欢夜夜爽一区| 日韩一区国产二区欧美三区| 蜜桃av噜噜一区二区三区小说| 日韩午夜中文字幕| 黄页视频在线91| 国产午夜精品一区二区三区视频| 国产永久精品大片wwwapp| 国产亚洲一区二区三区四区| 成人免费av资源| 亚洲欧美日韩国产综合| 日本高清不卡在线观看| 亚洲二区在线观看| 日韩一区二区三| 国产mv日韩mv欧美| 一区二区在线免费| 欧美日韩在线播放三区四区| 日韩精品一卡二卡三卡四卡无卡| 欧美一级免费观看| 国产精品一区二区视频| 国产精品国产三级国产| 欧美在线播放高清精品| 奇米色一区二区| 国产欧美日韩中文久久| 91网站黄www| 欧美bbbbb| 国产精品美女视频| 欧美系列一区二区| 老司机午夜精品99久久| 国产精品毛片高清在线完整版| 欧美日韩一区精品| 国产精品综合一区二区| 亚洲综合色噜噜狠狠| 精品国产乱码久久久久久夜甘婷婷| 国产不卡免费视频| 日韩精品久久理论片| 国产蜜臀av在线一区二区三区 | 国产高清不卡一区二区| 亚洲欧洲精品一区二区三区不卡| 欧美性欧美巨大黑白大战| 极品少妇xxxx偷拍精品少妇| 一区在线观看免费| 欧美大白屁股肥臀xxxxxx| a美女胸又www黄视频久久| 日本视频在线一区| 中文字幕中文字幕中文字幕亚洲无线| 欧美乱妇20p| 成人一道本在线| 肉色丝袜一区二区| 亚洲日本成人在线观看| 久久久一区二区三区| 欧美美女视频在线观看| 99久久婷婷国产综合精品电影| 麻豆91在线观看| 韩国理伦片一区二区三区在线播放| 久久蜜臀中文字幕| 亚洲黄色片在线观看| 精品视频在线免费观看| 免费成人在线网站| 91小视频在线| 成人综合在线观看| 久久嫩草精品久久久精品一| 久久丝袜美腿综合| 日本一区二区电影| 亚洲欧美一区二区三区极速播放 | 中文字幕字幕中文在线中不卡视频| 中文字幕亚洲成人| 洋洋成人永久网站入口| 天堂va蜜桃一区二区三区 | 国产不卡视频一区二区三区| 99久久99久久久精品齐齐| 91精品福利在线| 日韩欧美国产综合在线一区二区三区| 欧美tk—视频vk| 日韩美女久久久| 日韩二区三区在线观看| 国产精品一区在线| 色哟哟欧美精品| 日韩一级免费观看| 国产精品视频yy9299一区| 悠悠色在线精品| 久久成人久久鬼色| 91捆绑美女网站| 日韩精品一区二区三区四区| 国产精品美女一区二区| 日本在线不卡视频| 99视频一区二区| 日韩午夜中文字幕| 一区二区三区在线免费播放| 精品写真视频在线观看| 91免费在线看| 精品久久久久99| 亚洲午夜三级在线| 成人精品小蝌蚪| 日韩三级电影网址| 亚洲一区在线看| 成人综合婷婷国产精品久久| 91麻豆精品国产91久久久久久久久 | 一区二区在线观看视频在线观看| 精品一区二区成人精品| 色欧美乱欧美15图片| 久久伊99综合婷婷久久伊| 亚洲国产精品久久一线不卡| 粉嫩aⅴ一区二区三区四区五区| 欧美高清视频在线高清观看mv色露露十八| 中文幕一区二区三区久久蜜桃| 日本伊人色综合网| 欧美特级限制片免费在线观看| 国产精品久久久久影院亚瑟| 国产一区二区在线影院| 91精选在线观看| 亚洲精品免费播放| 99久久国产综合色|国产精品| 精品国产自在久精品国产| 亚洲成人三级小说| 一本色道**综合亚洲精品蜜桃冫| 国产亚洲一区字幕| 国产呦萝稀缺另类资源| 日韩一区二区电影在线| 自拍偷拍亚洲欧美日韩| 亚洲精品在线三区| 99精品国产视频| 日韩精品一区第一页| 国产精品乡下勾搭老头1| 日韩一区二区在线观看视频 | 欧美福利视频一区| 亚洲一区二区三区小说| av日韩在线网站| 欧美国产一区二区| 成人高清伦理免费影院在线观看| 精品福利一二区| 国精品**一区二区三区在线蜜桃| 日韩欧美成人午夜| 久久精品国产999大香线蕉| 欧美一区二区视频免费观看| 日日夜夜精品视频天天综合网| 欧美日韩免费不卡视频一区二区三区| 亚洲综合精品自拍| 欧美午夜片在线看| 亚洲国产成人av好男人在线观看| 欧美日韩激情在线| 日产国产高清一区二区三区| 欧美一区二区三区小说| 精品在线免费视频| 亚洲精品一区二区在线观看| 国产精品亚洲成人| 亚洲欧洲精品一区二区三区不卡| 99精品国产视频| 亚洲观看高清完整版在线观看| 欧美高清视频在线高清观看mv色露露十八 | av午夜一区麻豆| 夜夜爽夜夜爽精品视频| 欧美日韩精品欧美日韩精品一| 日本不卡一区二区三区| 久久色中文字幕| 成人免费av资源| 伊人婷婷欧美激情| 欧美一级精品在线| 国产一区 二区| 亚洲精品视频一区二区| 欧美日韩精品一区二区三区| 久久精品免费观看| 国产精品欧美一级免费| 精品视频在线免费观看| 精品一区二区三区在线播放视频 | 亚洲一区二区免费视频| 日韩精品中文字幕一区二区三区 | 精品在线播放午夜|