G
G
Hi~
you guys.
I come across the code below:
/////////////////////////////////////////////////////////
#include <stdio.h>
void foo(const char **pp)
{
*pp=NULL;
//it works too
//*pp="Hello world!";
}
int main()
{
const char *p="hello";
foo(&p);
printf("%s",p);
return 0;
}
//////////////////////////////////////////////////////////
It was compiled successed without no warn or error.
Why can *pp change , though " const char **pp " meant it couldn't ?
Thank you !
you guys.
I come across the code below:
/////////////////////////////////////////////////////////
#include <stdio.h>
void foo(const char **pp)
{
*pp=NULL;
//it works too
//*pp="Hello world!";
}
int main()
{
const char *p="hello";
foo(&p);
printf("%s",p);
return 0;
}
//////////////////////////////////////////////////////////
It was compiled successed without no warn or error.
Why can *pp change , though " const char **pp " meant it couldn't ?
Thank you !