current position:Home>Input two strings STR1 and STR2, connect the string STR1 to STR2, and output STR1 and its length (prompt: string connection function: strcat (STR1, STR2) string length calculation function: strlen (STR))

Input two strings STR1 and STR2, connect the string STR1 to STR2, and output STR1 and its length (prompt: string connection function: strcat (STR1, STR2) string length calculation function: strlen (STR))

2022-02-02 22:58:38 CSDN Q & A

How to str1 Link to str2, Has been an error , Enter two strings str1,str2, The string str1 Connect to str2, Output str1 And its length ( Tips : String concatenation function :strcat(str1,str2) String length calculation function :strlen(str))




Refer to the answer 1:

It can be used StringBuilder Splicing . Then get the length




Refer to the answer 2:



Refer to the answer 3:

Whether the space length is enough to store the string after the combination of two strings




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022258364914.html

Random recommended