How to understand strcpy cp function
This article mainly explains "how to understand the strcpy cp function". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to understand the strcpy cp function".
# include
# include
# define WORDS "RTY"
Main ()
{
Char * ptr=WORDS
Char bb = "be the best that you can beasts!"
Puts (ptr)
Puts ("\ n")
Puts (bb)
Puts ("\ n")
Strcpy (bb+7,ptr)
Puts (bb)
Puts ("\ n")
Printf ("bb1:%s\ n", bb)
Bb [10] ='1'
Printf ("bb2:%s\ n", bb)
}
It indicates that if the strcpy function is a string cp, the data behind the overwritten string will be truncated by default. The printed result is as follows:
RTY
Be the best that you can be!!
Be the RTY
Bb1:be the RTY
Bb2:be the RTY1 that you can be!!
Thank you for your reading, the above is the content of "how to understand the strcpy cp function", after the study of this article, I believe you have a deeper understanding of how to understand the strcpy cp function, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!