分享

C标准库

 zrx网 2018-06-02

介绍:包含string.h里面所有函数的解释;字符串比较,复制、连接、查找、分解。

1.复制相关函数:

(1)memcpy函数

  1. <span style="font-size:16px;">void * memcpy ( void * destination, const void * source, size_t num );</span>  

介绍:从 source指针地址(源指针)复制 num 个字节到 destination指针地址(目标指针)

源指针和目标指针指向的对象的底层类型与此函数无关;结果是数据的二进制拷贝

该函数不检查源中的任何终止null字符—它总是复制num字节。

为了避免溢出,目标指针和源参数指向的数组的大小至少应该是num字节,并且不应该重叠(对于重叠的内存块,memmove是一种更安全的方法)。

  1. <span style="font-size:14px;">/* memcpy example */  
  2. #include <stdio.h>  
  3. #include <string.h>  
  4.   
  5. struct {  
  6.   char name[40];  
  7.   int age;  
  8. } person, person_copy;//person, person_copy 为结构体成员如此只有这两个可以使用这两个成员可以使用这个结构体  
  9.   
  10. int main ()  
  11. {  
  12.   char myname[] = "Pierre de Fermat";  
  13.   
  14.   /* using memcpy to copy string: */  
  15.   memcpy ( person.name, myname, strlen(myname)+1 );//把myname复制给person.name  
  16.   person.age = 46;  
  17.   
  18.   /* using memcpy to copy structure: */  
  19.   memcpy ( &person_copy, &person, sizeof(person) );  
  20.   
  21.   printf ("person_copy: %s, %d \n", person_copy.name, person_copy.age );  
  22.   
  23.   return 0;  
  24. }</span>  
  1. /* memcpy example */  
  2. #include <stdio.h>  
  3. #include <string.h>  
  4. using namespace std;  
  5. struct Person {  
  6.     char name[40];  
  7.     int age;  
  8. };//Person为一种结构体类型  
  9. int main()  
  10. {  
  11.     char myname[] = "Pierre de Fermat";  
  12.     Person person, person_copy;//person 与 person_copy为结构体Person的实例化对象  
  13.     /* using memcpy to copy string: */  
  14.     memcpy(person.name, myname, strlen(myname) + 1);//把myname复制给person.name  
  15.     person.age = 46;  
  16.   
  17.   
  18.     /* using memcpy to copy structure: */  
  19.     memcpy(&person_copy, &person, sizeof(person));  
  20.   
  21.   
  22.     printf("person_copy: %s, %d \n", person_copy.name, person_copy.age);  
  23.   
  24.   
  25.     return 0;  
  26. }  

(2)memmove函数

  1. void * memmove ( void * destination, const void * source, size_t num );  

介绍:将num字节的值从source指向的位置(源指针)复制到destination指向(目标指针)的内存块。复制的过程就像使用了一个中间缓冲区一样,允许目标和源重叠。

源指针和目标指针指向的对象的底层类型与此函数无关;结果是数据的二进制拷贝

该函数不检查源中的任何终止null字符—它总是复制num字节。

为了避免溢出,目标指针和源参数指向的数组的大小至少应该是num字节。

  1. <span style="font-size:16px;">/* memmove example */  
  2. #include <stdio.h>  
  3. #include <string.h>  
  4.   
  5. int main ()  
  6. {  
  7.   char str[] = "memmove can be very useful......";  
  8.   memmove (str+20,str+15,11); // 为避免溢出 str 长度至少为32 = 20+11+1  
  9.   puts (str);  
  10.   return 0;  
  11. }</span>  


(3)strcpy函数

  1. char * strcpy ( char * destination, const char * source );  

介绍:将源(source)指向的char字符串复制到目标(destination)指向的数组中,包括终止的空字符(并在此停止)

为了避免溢出,目标指向的数组的大小应该足够长,以包含与源相同的char字符串(包括终止的空字符),并且不应该在内存中与源重叠。

  1. /* strcpy example */  
  2. #include <stdio.h>  
  3. #include <string.h>  
  4. #include<iostream>  
  5. using namespace std;  
  6. int main()  
  7. {  
  8.     char str1[] = "Sample string";  
  9.     char str2[40];  
  10.     char str3[40];  
  11.     strcpy(str2, str1);  
  12.     strcpy(str3, "copy successful");  
  13.     /*strcpy_s(str2, str1); 
  14.     strcpy_s(str3, "copy successful");*/  //调试过程中系统提示,strcopy_s 更安全  
  15.     printf("str1: %s\nstr2: %s\nstr3: %s\n", str1, str2, str3);  
  16.     system("pause");  
  17.     return 0;  
  18. }  
strcpy_s和strcpy()函数的功能几乎是一样的。strcpy函数,就象gets函数一样,它没有方法来保证有效的缓冲区尺寸,所以它只能假定缓冲足够大来容纳要拷贝的字符串。在程序运行时,这将导致不可预料的行为。用strcpy_s就可以避免这些不可预料的行为。

这个函数用两个参数、三个参数都可以,只要可以保证缓冲区大小。


(4)strncpy函数

  1. <span style="font-size:16px;">char * strncpy ( char * destination, const char * source, size_t num );</span>  

介绍:将源(source)的第一个长为 num 字符复制到目标(destination)。如果源char字符串的末尾(由一个空字符表示)在num字符被复制之前被发现,那么目的地将被添加0,直到数字字符被写入到它为止。(如果num大于source字符串的长度,则在超过部分添0)。

如果源长于num,则在目标的末尾不隐式添加任何空字符。因此,在这种情况下,目标不应被视为空终止的C字符串(读取该字符串时将会溢出)。

目标指针和源指针不能重叠。

  1. <span style="font-size:16px;">/* strncpy example */  
  2. #include <stdio.h>  
  3. #include <string.h>  
  4. #include<iostream>  
  5. using namespace std;  
  6. int main()  
  7. {  
  8.     char str1[] = "To be or not to be";  
  9.     char str2[40];  
  10.     char str3[40];  
  11.   
  12.     /* copy to sized buffer (overflow safe): */  
  13.     strncpy(str2, str1, sizeof(str2));  
  14.     /* partial copy (only 5 chars): */  
  15.     strncpy(str3, str2, 5);  
  16.     str3[5] = '\0';   /* null character manually added */  
  17.   
  18.     /* copy to sized buffer (overflow safe): */  
  19.     //strncpy_s(str2, str1, sizeof(str2));  
  20.     ///* partial copy (only 5 chars): */  
  21.     //strncpy_s(str3, str2, 5);  
  22.     //str3[5] = '\0';/* null character manually added */ //调试过程提示用strncpy_s 更安全  
  23.   
  24.     puts(str1);  
  25.     puts(str2);  
  26.     puts(str3);  
  27.     system("pause");  
  28.     return 0;  
  29. }</span>  

使用strncpy_s, 微软做了安全检测,防止缓冲越界,与strcpy 与 strcpy_s情况差不多。


2:字符换串联,连结

(1)strcat函数

  1. char * strcat ( char * destination, const char * source );  

介绍:将源(source)字符串的副本附加到目标(destination)字符串。目标中的终止null字符由源的第一个字符覆盖,而在目标的连接中所形成的新字符串的末尾包含一个空字符。

目标指针和源指针不能重叠。

  1. <span style="font-size:16px;">/* strcat example */  
  2. #include <stdio.h>  
  3. #include <string.h>  
  4. #include<iostream>  
  5. using namespace std;  
  6. int main()  
  7. {  
  8.     char str[80];  
  9.     strcpy(str, "these ");  
  10.     strcat(str, "strings ");  
  11.     strcat(str, "are ");  
  12.     strcat(str, "concatenated.");  
  13.     /*strcpy_s(str, "these "); 
  14.     strcat_s(str, "strings "); 
  15.     strcat_s(str, "are "); 
  16.     strcat_s(str, "concatenated.");*/  //使用跟安全的函数  
  17.     puts(str);  
  18.     system("pause");  
  19.     return 0;  
  20. }</span>  

(2)strncat函数

介绍:将源的第一个num字符附加到目标,以及一个终止的空字符。

如果源中的char字符串的长度小于num,则只复制到终止空字符之前的内容。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strncat example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char str1[20];  
  12.     char str2[20];  
  13.     /*strcpy(str1, "To be "); 
  14.     strcpy(str2, "or not to be"); 
  15.     strncat(str1, str2, 6);*/  
  16.     strcpy_s(str1, "To be ");  
  17.     strcpy_s(str2, "or not to be");  
  18.     strncat_s(str1, str2, 6);       //使用安全类型  
  19.     puts(str1);  
  20.     system("pause");  
  21.     return 0;  
  22. }  


3.比较

(1)memcmp函数

  1. int memcmp ( const void * ptr1, const void * ptr2, size_t num );  

解释:将ptr1所指向的内存块的第一个num字节与ptr2所指向的第一个num字节进行比较,如果它们都匹配,则返回0;如果不匹配,则返回与0不同的值,表示哪个值更大。<0,表示ptr1<ptr2;>0,表示ptr1>ptr2;

与strcmp不同,函数在找到null字符后不会停止比较

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* memcmp example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char buffer1[] = "DWgaOtP12df0";  
  12.     char buffer2[] = "DWGAOTP12DF0";  
  13.   
  14.     int n;  
  15.   
  16.     n = memcmp(buffer1, buffer2, sizeof(buffer1));  
  17.   
  18.     if (n>0)   
  19.         printf("'%s' is greater than '%s'.\n", buffer1, buffer2);  
  20.     else if (n<0)   
  21.         printf("'%s' is less than '%s'.\n", buffer1, buffer2);  
  22.     else   
  23.         printf("'%s' is the same as '%s'.\n", buffer1, buffer2);  
  24.     system("pause");  
  25.     return 0;  
  26. }  

(2)strcmp函数

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

解释:比较char字符串str1和char字符串str2。

这个函数开始比较每个字符串的第一个字符。如果它们彼此相等,它将继续执行以下对,直到字符不同或到达终止的空字符为止。

这个函数执行字符的二进制比较。对于考虑特定于地区的规则的函数,请参见strcoll。

返回值:0表示str1 = str2;<0 str1<str2 ;  >0  str1 > str2;

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. #include <stdio.h>  
  6. #include <string.h>  
  7.   
  8. int main()   //输入apple时跳出循环  
  9. {  
  10.     char key[] = "apple";  
  11.     char buffer[80];  
  12.     do  
  13.     {  
  14.         printf("Guess my favorite fruit? ");  
  15.         fflush(stdout);  
  16.         scanf("%79s", buffer);  
  17.     } while (strcmp(key, buffer) != 0);  
  18.     puts("Correct answer!");  
  19.     system("pause");  
  20.     return 0;  
  21. }  


(3)strcoll函数

  1. int strcoll ( const char * str1, const char * str2 );  

解释:将C字符串str1与C字符串str2进行比较,两者都根据当前选择的C语言环境的LC_COLLATE类别进行适当解释。

这个函数开始比较每个字符串的第一个字符。如果它们彼此相等,则继续使用下面的一对,直到字符不同,或者直到到达表示字符串结束的空字符为止。这个函数的行为取决于所选C语言环境的LC_COLLATE类别。

(4)strncmp函数

  1. int strncmp ( const char * str1, const char * str2, size_t num );  

解释:将C字符串str1与C字符串str2的num个字符进行比较。

这个函数开始比较每个字符串的第一个字符。如果它们彼此相等,它将继续执行以下对,函数结束条件:(1)直到字符不同,(2)直到到达终止的空字符为止,(3)或者直到两个字符串中的num字符匹配为止。(无论哪个是第一个)

返回值:0表示str1 = str2;<0 str1<str2 ;  >0  str1 > str2;

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strncmp example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char str[][5] = { "R2D2" , "C3PO" , "R2A6" };  
  12.     int n;  
  13.     puts("Looking for R2 astromech droids...");  
  14.     for (n = 0; n<3; n++)  
  15.         if (strncmp(str[n], "R2xx", 2) == 0)  
  16.         {  
  17.             printf("found %s\n", str[n]);  
  18.         }  
  19.     system("pause");  
  20.     return 0;  
  21. }  

(5)strxfrm函数

  1. size_t strxfrm ( char * destination, const char * source, size_t num );  
解释:根据当前语言环境转换源指向的char字符串,并将转换后的字符串的第一个num字符串复制到目标,返回其长度。

另一种方法是,通过为目标指定一个空指针,为num指定一个零,该函数只能用于检索长度

目标指针和源指针不能重叠。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strncmp example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char str[][5] = { "R2D2" , "C3PO" , "R2A6" };  
  12.     int n;  
  13.     puts("Looking for R2 astromech droids...");  
  14.     n = strxfrm(NULL, str[0], 0);  
  15.     cout << n << endl;//str[0] 的字符串长度为 n + 1  
  16.     system("pause");  
  17.     return 0;  
  18. }  

搜索:

(1)memchr函数

  1. const void * memchr ( const void * ptr, int value, size_t num );  
  2.       void * memchr (       void * ptr, int value, size_t num );  

解释:在 ptr 所指向的内存块的第一个num字节中搜索第一次出现  value (被解释为无符号字符),并返回一个指向它的指针。

ptr数组上选中每个字节 和 value 都被解释为 unsigned char,来进行比较

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* memchr example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()      //寻找str中的p位置  
  10. {  
  11.     char * pch;  
  12.     char str[] = "Example string";  
  13.     pch = (char*)memchr(str, 'p', strlen(str));  
  14.     if (pch != NULL)  
  15.         printf("'p' found at position %d.\n", pch - str + 1);  
  16.     else  
  17.         printf("'p' not found.\n");  
  18.     system("pause");  
  19.     return 0;  
  20. }  

(2)strchr函数

  1. const char * strchr ( const char * str, int character );  
  2.       char * strchr (       char * str, int character );  

介绍:返回:character在 str第一次出现的地方。

终止的空字符被认为是  char 字符串的一部分。 因此,它也可以被定位以检索指向字符串结尾的指针。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strchr example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main() // 输出str中所有s的位置。  
  10. {  
  11.     char str[] = "This is a sample string";  
  12.     char * pch;  
  13.     printf("Looking for the 's' character in \"%s\"...\n", str);  
  14.     pch = strchr(str, 's');  
  15.     while (pch != NULL)  
  16.     {  
  17.         printf("found at %d\n", pch - str + 1);  
  18.         pch = strchr(pch + 1, 's');  
  19.     }  
  20.     system("pause");  
  21.     return 0;  
  22. }  

(3)strcspn函数

  1. size_t strcspn ( const char * str1, const char * str2 );  
介绍:扫描str1以查找第一次出现任何字符属于str2,并返回在第一次出现之前读取的str1的字符数。

搜索包括终止空字符。 因此,如果在str1中找不到str2的任何字符,函数将返回str1的长度。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strcspn example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char str[] = "fcba73";  
  12.     char keys[] = "1234567890";  
  13.     int i;  
  14.     i = strcspn(str, keys);  
  15.     printf("The first number in str is at position %d.\n", i + 1);  
  16.   
  17.     system("pause");  
  18.     return 0;  
  19. }  

(4)strpbrk函数

  1. const char * strpbrk ( const char * str1, const char * str2 );  
  2.       char * strpbrk (       char * str1, const char * str2 );  

介绍:返回str1中第一个出现在str2中的任何字符的指针,如果没有匹配(即str1中不含有str2中的任何字符),则返回空指针。

搜索不包括任何字符串的终止空字符,但在那里结束

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strpbrk example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()      //测试str 中出现 key 中字符的情况 i i a a e i   
  10. {  
  11.     char str[] = "This is a sample string";  
  12.     char key[] = "aeiou";  
  13.     char * pch;  
  14.     printf("Vowels in '%s': ", str);  
  15.     pch = strpbrk(str, key);  
  16.     while (pch != NULL)  
  17.     {  
  18.         printf("%c ", *pch);  
  19.         pch = strpbrk(pch + 1, key);  
  20.     }  
  21.     printf("\n");  
  22.     system("pause");  
  23.     return 0;  
  24. }  

(5)strrchr函数

  1. const char * strrchr ( const char * str, int character );  
  2.       char * strrchr (       char * str, int character );  

介绍:返回character 在str 最后一次出现的指针。

终止空字符被认为是  char 字符串的一部分。 因此,它也可以位于检索指向字符串结尾的指针。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strrchr example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()        //输出s在str中最后一次出现的位置  
  10. {  
  11.     char str[] = "This is a sample string";  
  12.     char * pch;  
  13.     pch = strrchr(str, 's');  
  14.     printf("Last occurence of 's' found at %d \n", pch - str + 1);  
  15.     system("pause");  
  16.     return 0;  
  17. }  

(6)strspn函数

  1. size_t strspn ( const char * str1, const char * str2 );  

介绍:返回str2包含的字符在str1中出现过多少次。

搜索不包括任何字符串的终止空字符,但在那里结束。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strspn example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     int i;  
  12.     char strtext[] = "129th";  
  13.     char cset[] = "1234567890";  
  14.   
  15.     i = strspn(strtext, cset);//strtext中1 2 9来自cset  
  16.     printf("The initial number has %d digits.\n", i);  
  17.     system("pause");  
  18.     return 0;  
  19. }  

(7)strstr函数

  1. const char * strstr ( const char * str1, const char * str2 );  
  2.       char * strstr (       char * str1, const char * str2 );  

介绍:返回str1中第一次出现str2的指针,如果str2不是str1的一部分,则返回空指针。

匹配过程不包括终止空字符,但它停在那里。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strstr example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()       //用sample 替换 simple  
  10. {  
  11.     char str[] = "This is a simple string";  
  12.     char * pch;  
  13.     pch = strstr(str, "simple");  
  14.     strncpy(pch, "sample", 6);  
  15.     puts(str);  
  16.     system("pause");  
  17.     return 0;  
  18. }  

(8)strtok函数

  1. char * strtok ( char * str, const char * delimiters );  

介绍:将字符串拆分为令牌,对此函数的一系列调用将str分割为令牌,这些有delimiters中的任意部分分隔成一系列令牌。

在第一次调用时,函数需要一个C字符串作为str的参数,其第一个字符用作扫描令牌的起始位置。 在随后的调用中,函数需要一个空指针,并将最后一个标记结束后的位置用作新的扫描起始位置。

为了确定一个标记的开始和结束,函数首先从delimiters中不包含的第一个字符的起始位置开始扫描(这成为标记的开始)。 然后从delimiters的第一个字符的标记开始扫描,这将成为标记的结尾。 如果找到终止空字符,扫描也会停止。

该标记的这一端自动被一个空字符替换,并且该标记的开始由该函数返回。

一旦在strtok的调用中发现了str的终止空字符,则对此函数的所有后续调用(使用空指针作为第一个参数)将返回一个空指针。

找到最后一个标记的位置由函数内部保存,以便在下次调用时使用(不需要特定的库实现来避免数据竞争)。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strtok example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char str[] = "- This, a sample string.";  
  12.     char * pch;  
  13.     printf("Splitting string \"%s\" into tokens:\n", str);  
  14.     pch = strtok(str, " ,.-");  
  15.     while (pch != NULL)  
  16.     {  
  17.         printf("%s\n", pch);  
  18.         pch = strtok(NULL, " ,.-");  
  19.     }  
  20.       
  21.     /*char str[] = "- This, a sample string.";  // 安全类型调试 
  22.     char * pch; 
  23.     char* buf; 
  24.     printf("Splitting string \"%s\" into tokens:\n", str); 
  25.     pch = strtok_s(str, " ,.-",&buf); 
  26.     printf("%s\n", pch); 
  27.     printf("buf %s\n", buf); 
  28.     while (pch != NULL) 
  29.     { 
  30.         printf("%s\n", pch); 
  31.         printf("buf %s\n", buf); 
  32.         pch = strtok_s(NULL, " ,.-", &buf); 
  33.     }*/  
  34.     system("pause");  
  35.     return 0;  
  36. }  

其它

(1)memset函数

  1. void * memset ( void * ptr, int value, size_t num );  
解释:将由ptr指向的内存块的第一个num字节设置为指定的 value(转换为unsigned char)。
  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* memset example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char str[] = "almost every programmer should know memset!";  
  12.     memset(str, '-', 6);  
  13.     puts(str);  
  14.   
  15.     int test[10];  
  16.     memset(test, 56, 10 *sizeof(char) );  
  17.     for (int i = 0; i < 10; i++)  
  18.     {  
  19.         cout << test[i] << endl;  
  20.     }  
  21.     system("pause");  
  22.     return 0;  
  23. }  

测试发现memset函数用来内存块清零效果不错,统一赋值操作只适合char数组


(2)strerror函数

  1. char * strerror ( int errnum );  

介绍:解释errnum的值,生成一个字符串,其中包含描述错误条件的消息,就像通过库函数设置为errno一样。

返回的指针指向一个静态分配的字符串,不能被程序修改。 对该函数的进一步调用可能会覆盖其内容(特定的库实现不需要避免数据竞争)。

由strerror生成的错误字符串可能特定于每个系统和库实现。

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strerror example : error list */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8. #include <errno.h>  
  9.   
  10. int main()  
  11. {  
  12.     FILE * pFile;  
  13.     pFile = fopen("unexist.ent", "r");  
  14.     if (pFile == NULL)  
  15.         printf("Error opening file unexist.ent: %s\n", strerror(errno));  
  16.     system("pause");  
  17.     return 0;  
  18. }  

(3)strlen函数

  1. size_t strlen ( const char * str );  

介绍:返回 char 字符串str的长度。

char 字符串的长度由终止空字符确定:char 字符串的长度与字符串开头与终止空字符(不包括终止空字符本身)之间的字符数。

这不应该与包含该字符串的数组的大小相混淆

  1. #include<iostream>  
  2. using namespace std;  
  3.   
  4.   
  5. /* strlen example */  
  6. #include <stdio.h>  
  7. #include <string.h>  
  8.   
  9. int main()  
  10. {  
  11.     char szInput[256];  
  12.     printf("Enter a sentence: ");  
  13.     gets_s(szInput);  
  14.     printf("The sentence entered is %u characters long.\n", (unsigned)strlen(szInput));  
  15.     system("pause");  
  16.     return 0;  
  17. }  




    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多