首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

cstring

This header was originally in the C standard library as <string.h>.

This header is for C-style null-terminated byte strings.

Macros

NULL

implementation-defined null pointer constant (macro constant)

Types

size_t

unsigned integer type returned by the sizeof operator (typedef)

Functions

| String manipulation |

|:----|

| strcpy | copies one string to another (function) |

| strncpy | copies a certain amount of characters from one string to another (function) |

| strcat | concatenates two strings (function) |

| strncat | concatenates a certain amount of characters of two strings (function) |

| strxfrm | transform a string so that strcmp would produce the same result as strcoll (function) |

| String examination |

| strlen | returns the length of a given string (function) |

| strcmp | compares two strings (function) |

| strncmp | compares a certain amount of characters of two strings (function) |

| strcoll | compares two strings in accordance to the current locale (function) |

| strchr | finds the first occurrence of a character (function) |

| strrchr | finds the last occurrence of a character (function) |

| strspn | returns the length of the maximum initial segment that consists of only the characters found in another byte string (function) |

| strcspn | returns the length of the maximum initial segment that consists of only the characters not found in another byte string (function) |

| strpbrk | finds the first location of any character from a set of separators (function) |

| strstr | finds the first occurrence of a substring of characters (function) |

| strtok | finds the next token in a byte string (function) |

| Character array manipulation |

| memchr | searches an array for the first occurrence of a character (function) |

| memcmp | compares two buffers (function) |

| memset | fills a buffer with a character (function) |

| memcpy | copies one buffer to another (function) |

| memmove | moves one buffer to another (function) |

| Miscellaneous |

| strerror | returns a text version of a given error code (function) |

Notes

  • NULL is also defined in the following headers:
    • <clocale>
    • <ctime>
    • <cstddef>
    • <cstdio>
    • <cwchar>
  • std::size_t is also defined in the following headers:
    • <ctime>
    • <cstddef>
    • <cstdio>
    • <cwchar>
代码语言:txt
复制
 © cppreference.com

Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.

扫码关注腾讯云开发者

领取腾讯云代金券