How to understand
8 and 9 6 topic
CodePudding user response:
First, the sum function is introduced into a pointer, after passing a pointer pointing to the current value to a value, and so on after the cycle 0 1 2 3 local values into 4,
Second, to the address and the ASCII value of a, b, respectively, after add 1 b to b printed character, the function returns after because b is passed the address modification refers to the character of memory, and a not so print for a, b
Last one, I think the answer is not the only, first declare functions, then under the certain function parameters and use it every time is the same, copy is empty first, second, use is ok, I think this pointer with initialization he for & amp; A, need not be NULL or zero, then if use pointer to function x, useless & amp; A, then in to the operations of the value of the pointer to the while, so use * a,
CodePudding user response:
reference 1/f, it is a nice nickname response: first, the sum function is introduced into a pointer, after passing a pointer pointing to the current value to a value, and so on after the cycle 0 1 2 3 local values into 4, Second, to the address and the ASCII value of a, b, respectively, after add 1 b to b printed character, the function returns after because b is passed the address modification refers to the character of memory, and a not so print for a, b Last one, I think the answer is not the only, first declare functions, then under the certain function parameters and use it every time is the same, copy is empty first, second, use is ok, I think this pointer with initialization he for & amp; A, need not be NULL or zero, then if use pointer to function x, useless & amp; A, then in to the operations of the value of the pointer to the while, so use * a, The first question in a [0]=[1] a should not be changed to a [I]=] [I - 1 a? The second void functions is not can't return? Thank you CodePudding user response:
A [0] a [I] instead, then, I come from? Is a [0], that is because, the inside is aa [I] address, here is the position of the pointer to the I, let you can treat as is to create an array, and then a [0]=aa [I], a [1]=aa + 1] [I... A [n]=aa + n] [I Then the second, void not return a value, but can return, and then the cause of the problem is not the function returns, because the b address & amp; B, through this address on the value of the pointer changes the original value of the variable will be altered, char when b allocates memory to store the size of a char data 'a', and then & amp; B is the address, b is the * (& amp; B) is this address the value of the representative, through & amp; B to modify the value of "b" so * (& amp; B) nature also becomes a 'b', is the char b becomes a 'b' CodePudding user response:
this is a nice nickname reference 3 floor response: change a [0] a [I] so, I come from? Is a [0], that is because, the inside is aa [I] address, here is the position of the pointer to the I, let you can treat as is to create an array, and then a [0]=aa [I], a [1]=aa + 1] [I... A [n]=aa + n] [I Then the second, void not return a value, but can return, and then the cause of the problem is not the function returns, because the b address & amp; B, through this address on the value of the pointer changes the original value of the variable will be altered, char when b allocates memory to store the size of a char data 'a', and then & amp; B is the address, b is the * (& amp; B) is this address the value of the representative, through & amp; B to modify the value of "b" so * (& amp; B) naturally becomes the 'b', is the char b becomes a "b" Thank you, a little understood, if the second question is, the first execution void functions and output b, b for the second time because b is changed address change don't come back, and a is the original 'a' CodePudding user response:
reference 4 floor qq_45852575 response: Quote: this is a nice nickname reference 3 floor response: change a [0] a [I] so, I come from? Is a [0], that is because, the inside is aa [I] address, here is the position of the pointer to the I, let you can treat as is to create an array, and then a [0]=aa [I], a [1]=aa + 1] [I... A [n]=aa + n] [I Then the second, void not return a value, but can return, and then the cause of the problem is not the function returns, because the b address & amp; B, through this address on the value of the pointer changes the original value of the variable will be altered, char when b allocates memory to store the size of a char data 'a', and then & amp; B is the address, b is the * (& amp; B) is this address the value of the representative, through & amp; B to modify the value of "b" so * (& amp; B) naturally becomes the 'b', is the char b becomes a "b" Thank you, a little understood, if the second question is, the first execution void functions and output b, b for the second time because b is changed address change don't come back, and a is the original 'a' B change not address is changed by address data, such as science and technology road no. 213 (char place b) was a small bungalow (' a '), and now to write the address slip (pointer) to the construction workers (function fun ()), they find the bungalow (data 'a') tear open the cover (* * c=c + 1) became a floor (' b '), so I again according to the address (char b address) to find something, find is the floor (' b '), CodePudding user response:
this is a nice nickname reference 5 floor response: Quote: refer to 4th floor qq_45852575 response: Quote: this is a nice nickname reference 3 floor response: change a [0] a [I] so, I come from? Is a [0], that is because, the inside is aa [I] address, here is the position of the pointer to the I, let you can treat as is to create an array, and then a [0]=aa [I], a [1]=aa + 1] [I... A [n]=aa + n] [I Then the second, void not return a value, but can return, and then the cause of the problem is not the function returns, because the b address & amp; B, through this address on the value of the pointer changes the original value of the variable will be altered, char when b allocates memory to store the size of a char data 'a', and then & amp; B is the address, b is the * (& amp; B) is this address the value of the representative, through & amp; B to modify the value of "b" so * (& amp; B) naturally becomes the 'b', is the char b becomes a "b" Thank you, a little understood, if the second question is, the first execution void functions and output b, b for the second time because b is changed address change don't come back, and a is the original 'a' B change not address is changed by address data, such as science and technology road no. 213 (char place b) was a small bungalow (' a '), and now to write the address slip (pointer) to the construction workers (function fun ()), they find the bungalow (data 'a') tear open the cover (* * c=c + 1) became a floor (' b '), so I again according to the address (char b address) to find things, find the floor (' b ') is the Thank you very much for your patience, I understand CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html