Need help understanding char and int pointers
In this code to print the value of int and char pointer variables, why do
I access them differently? For the char pointer I write sampleclient but
for the int I write *intid. Why does one use * but not the other?
int main()
{
char client[] = "ABCD";
int intid = 10;
samplepass(&client, &intid);
return 0;
}
void samplepass(char *sampleclient, int *intid)
{
printf("%s %d\n", sampleclient, *intid);
}
No comments:
Post a Comment