C Programming Language Note (16) Reference manual 8

Source: Internet
Author: User
Tags mathematical functions strtok

Character Category Testing <ctype.h>

Header file <ctype.h> A function that declares some test characters each function has a parameter of type int, the parameter value must be EOF or the return value of the character function represented by the unsigned char type int type if the parameter satisfies the specified condition then the function returns non 0, Otherwise, return 0isalnum (c);//function Isalpha (c) or IsDigit (c) is true Isalpha (c),//isupper (c) or Islower (c) is true Iscntrl (c);//whether control character isdigit (c); /whether the decimal digit isgraph (c);//whether the printable character is islower (c);//lowercase isprint (c);//The printable character of the space is ispunct (c);//except for the space character  printable character outside the number isspace (c);//Space break newline character carriage return tab isupper (c); Capital Letter Isxdigit (c);//hex digit

  

int ToLower (c);//C convert outer lowercase letter int toupper (c);//convert outer capital

  

String Functions <string.h>

Header file <string.h> defines two sets of string functions the first set of function names begins with Str the second set of function names starts with MEM except for the function memmove, other functions do not define the copy behavior between overlapping objects The comparison function will use the parameters as unsigned An array of type char treats

  

In the following table, the types of variables s and T are char *;cs and CT type is const char*;n Type I SIZE_TC type int (will be converted to char type);

  

Char *strcpy (S,CT);  Copy the string CT (including ' s ') into the string s and return Schar *strncpy (s,ct,n);//Copy the maximum n characters in the string CT into the string s and return s, if less than N, to fill char *strcat (S,CT) ;//connect string ct to the tail of s and return to Schar *strncat (s,ct,n);//int strcmp (CS,CT); ;//String comparison cs<ct returns a  negative number cs==ct returns  0  cs>ct returns a positive int strncmp (cs,ct,n); char *strchr (CS,C);// Returns a pointer to the position of character C at the first occurrence of the string CS if it does not contain C return Nullchar *STRRCHR (cs,c);//Ibid. size_t strspn (CS,CT); The return string CS contains the length of the prefix for the characters in CT size_t strcspn (cs,ct);//char *strpbrk (CS,CT);//Returns a pointer to the position of the first occurrence of any character in the string CT in the string cs. If not returned Nullchar *strstr (CS,CT);//Returns a pointer to the position where the string ct first appeared in the string CS size_t strlen (CS);//Returns the length of the string char *strerror (n);// Returns a pointer to the error message string corresponding to error number n char *strtok (S,CT);//strtok function in S search for a defined mark in CT the function that begins with MEM is to manipulate the object in the form of a character array the main purpose is to provide an efficient function interface void * memcpy (s,ct,n);//Copy the n characters of the string CT in S, return s

  

Mathematical Functions <math.h>

Utility Functions <stdlib.h>

Diagnostics <assert.h>

Variable parameter table <stdarg.h>

Non-local jump <setjmp.h>

Signal <signal.h>

Date and Time Functions <time.h>

Limitations related to specific implementations <limits.h> and <float.h >

C Programming Language Note (16) Reference manual 8

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.