I have the following code:
int main(int argc, char **argv)
{
printf("%s\n",*argv);
int test = 5;
char* p;
*pint = test;
p = "banana";
printf("%s\n",p);
printf("%d\n",*pint);
}
Why is it that I have to write p="banana"
and not *p="banana"
but for an integer, it needs to be *pint
, otherwise it will only print the address of the integer? Shouldn't p
print the address of "banana" ?