Unfamiliar C string processing functions

Source: Internet
Author: User
_ ITOA

In stdlib.

# Include <stdlib. h> <br/> # include <stdio. h> <br/> void main (void) <br/>{< br/> char buffer [20]; <br/> int I = 0x223; <br/> _ ITOA (I, buffer, 10); <br/> puts (buffer); <br/> _ ITOA (I, buffer, 16 ); <br/> printf ("0x % s/n", buffer); <br/> getchar (); <br/>}< br/> // 547 <br/> // 0x223 

 

Scanf, scanf_s

Fscanf, fscanf_s

The former is input directly, and the latter needs to specify the length.

Http://topic.csdn.net/u/20110609/20/61e146fb-3d92-43ee-a017-00080e74cd04.html? Seed = 2003693757 & R = 73768052 # r_73768052

Function Format control:

Http://hi.baidu.com/vhou/blog/item/a6c4c4b07139e7530923022b.html

 

 

long int strtol ( const char * str, char ** endptr, int base );

Convert string to long integer

 

String. h/cstring functionscopying:
Memcpy Copy block of memory (function)
Memmove Move block of memory (function)
Strcpy Copy string (function)
Strncpy Copy characters from string (function)

Concatenation:

Strcat Concatenate strings (function)
Strncat Append characters from string (function)

Comparison:

Memcmp Compare two blocks of memory (function)
Strcmp Compare two strings (function)
Strcoll Compare two strings using locale (function)
Strncmp Compare characters of two strings (function)
Strxfrm Transform string using locale (function)

Searching:

Memchr Locate character in block of memory (function)
Strchr Locate first occurrence of character in string (function)
Strcspns Get span until character in string (function)
Strpbrk Locate character in string (function)
Strrchr Locate last occurrence of character in string (function)
Strspns Get span of Character Set in string (function)
Strstr Locate substring (function)
Strtok Split string into tokens (function)

Other:

Memset Fill block of memory (function)
Strerror Get pointer to error message string (function)
Strlen Get String Length (function)

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.