Home > Back-end >  C and pointer after-school exercises programming problem in the third chapter 6 answers why is this
C and pointer after-school exercises programming problem in the third chapter 6 answers why is this

Time:12-05

Void reverse_string (char * STR)
{
Char * last_char;

For (last_char=STR; * str_char!='\ 0'; Last_char + +);
Last_char -;

While (str{
Char temp.
Temp=* STR;
* str++=* last_char;
* last_char -=temp;
}
}
The for loop the loop body is last_char -, wouldn't it be last_char moved to the outside of the border, and why last_char - after adjusting part is last_char + +, not offset by?

CodePudding user response:

For the end, last_char=='\ 0'
Last_char - to the last one character at a time,

CodePudding user response:

reference 1st floor ctrigger response:
for over, last_char=='\ 0'
Last_char - to the last one character at a time,
oh oh because the for loop behind have a semicolon so directly performed this statement right

CodePudding user response:

refer to the second floor IsTanbuL_Night response:
Quote: refer to 1st floor ctrigger response:
for over, last_char=='\ 0'
Last_char - to the last one character at a time,
oh oh because the for loop behind have a semicolon so directly after the statement right

For the back is a semicolon, last_char - not loop statements in the body

CodePudding user response:

reference 3 building self-confidence boy reply:
Quote: refer to the second floor IsTanbuL_Night response:
Quote: refer to 1st floor ctrigger response:
for over, last_char=='\ 0'
Last_char - to the last one character at a time,
oh oh because the for loop behind have a semicolon so directly after the statement right

The for is followed by a semicolon, last_char - not loop statements in the body
ok thank you
  • Related