In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "what are the strings and memory functions in c language". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what are strings and memory functions in c language".
one。 String function 1. Find the strlen of the string length
Size_t strlen (const char * str)
The string ends with'\ 0', and the strlen function returns the number of characters that appear before'\ 0' in the string (excluding'\ 0').
The string pointed to by the parameter must end with'\ 0'.
Note that the return value of the function is size_t, which is unsigned.
Simulation and implementation of strlen
Size_t my_strlen (const char*str) {size_t count=0; while (* str) {str++; count++;} 2. Compare strcmp of string size
Int strcmp (const char * str1, const char * str2)
Compare from the location where str1 and str2 point, if you encounter two unequal characters or the\ 0 function ends and returns a value.
The character of the first string is larger than that of the second string and returns a number > 0.
The character of the first string is equal to the character of the second string that returns a number of = 0.
The character of the first string whose character is less than the second string returns the 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.