Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do each of the str-function abbreviations/acronyms mean?

Tags:

The C standard library string.h contains several functions to manipulate strings, all of which start with str and end with an abbreviation. Some of these abbreviations are obvious:

  • strlen string length
  • strcpy string copy
  • strcmp string compare

Some are a bit less straightforward:

  • strpbrk string pointer break?
  • strspn string ...spn?
  • strrchr string ... R char??
  • strxfrm string... um... nevermind.

What do each of the str-function abbreviations/acronyms mean?

like image 819
MD XF Avatar asked Mar 04 '17 02:03

MD XF


1 Answers

  • strlen - find LENgth of string
  • strcpy - CoPY strings
  • strcmp - CoMPare strings
  • strrchr - Reversely find CHaRacter
  • strspn - calculate the length of SPaN of characters
  • strxfrm - TRANS (written as X)-FoRM a string
  • strpbrk - find the Point where string is BRoKen by any of the characters
like image 102
DYZ Avatar answered Sep 24 '22 11:09

DYZ