In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Today, the editor will share with you the relevant knowledge of what the strcat_s function principle of c language is. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
1. Dst memory space size = target string length + original string site +'\ 0'.
2. Use the sizeof function to get the memory space, and the strlen function to get the string length.
That is to get the size of memory space and the length of the lookup string.
Example
# include "stdafx.h" # include#include#include#include "windows.h" / / error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _ CRT_SECURE_NO_WARNINGS. See online help for details.#pragma warning (disable: 4996) void main () {char src [1024] = {"strlen strlen + tutorial-strcat_s function"}; char dst [1024] = {"www.codersrc.com"}; / / Note: the second parameter of strcat_s is calculated as the size of the concatenated string, not the original string size or the target string size int len = strlen (src) + strlen (dst) + 1 Printf ("dst:%s before strcat_s\ n", dst); / / strcat_s (dst, len, src); printf ("dst:%s after strcat_s\ n", dst); / / system ("pause"); output result: dst:www.codersrc.comC/C++ tutorial after dst:www.codersrc.comstrcat_s before strcat_s-Please press any key to continue. . . These are all the contents of the article "what is the principle of strcat_s function in c language". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.