Home > Back-end >  Ask why line 11 is?
Ask why line 11 is?

Time:11-26


Ask why line 11 is?
Topic is: compiler, connect two strings, don't use strcat function,
For a great god

CodePudding user response:


Sorry to take the wrong figure

CodePudding user response:

The building Lord, carefully think j + + and + + j, the difference between the three words is equivalent to: while (s2 [j].='\ 0')
{
S1=s 2 [j] [I];
I=I + 1;
J=j + 1;
}
Is first in operation again since the front is the first operation again,

CodePudding user response:

The third sentence line 13 is at the end of the string s1 end plus character '\ 0'

CodePudding user response:

Line 11 is whether string s2 is an empty string, '\ 0' is the default string band;
Line 12 is to connect s2 characters one by one on s1;
Line 13 is to '\ 0' added to after with string
  • Related