In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you some of the important C language strings and memory functions are how, concise and easy to understand, absolutely can make you shine, through the detailed introduction of this article I hope you can gain something.
I. String Functions 1. Find strlen for string length
size_t strlen ( const char * str );
String ends with '\0', strlen returns the number of characters that precede'\0'in the string (excluding'\0').
The string pointed to by the argument must end with '\0'.
Note that the return value of the function is size_t, which is unsigned.
Analog implementation strlen
size_t my_strlen(const char*str){ size_t count=0; while(*str) { str++; count++; }2. strcmp to compare string sizes
int strcmp ( const char * str1, const char * str2 );
The comparison starts at the position pointed to by str1 and str2, if two unequal characters are encountered or the\0 function ends and returns a value.
1 Returns numbers>0 if the first string character is greater than the second string character.
2 Returns the number =0 if the character of the first string equals the character of the second string.
3 The character of the first string is less than the character of the second string. Return ptr2 Return value>0;
ptr1=ptr2 return value =0;
ptr1
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.