Why the output hello_world ? and not llo_world


12/3/2019 8:23:02 PM


9 Answers

New Answer


Yes, if you don't dereference, you change the value (address) stored in param, not the value the address points to.


The thing is this: You want to change the original pointer, right? You pass a pointer TO the pointer to the function. So if you don't dereference in the function, you change the pointer to the pointer itself, not the pointer it is pointing to. It is the same with when you want to change an int: void f(int *n) { // We need to dereference ++*n;


HonFu ty


This seems to work: void myfunc(char** param) { ++*param; }


HonFu what's wrong with This code?


You are not dereferencing param in the function. If you change it to what I wrote, it works.


HonFu Is it call by value?


HonFu Does if mean we are just changing the address of param?


Recheck your code bro