i am a beginner and this question may sound dumb but anyway hope you guys can help. In this program, i have variable char a, b is a pointer to a, I pass address of b to function test. Then c is a pointer of b in function test, and c is pointer of pointer for variable a. My question is : Is there any possible way to dereference c and print out a. I dont want to print out a in main function, i want to do it in function test when test(&b) executed. Is there anyway to do that.
Below is my code (it is not completed cause i cant find the way to dereference c to get a in function test). Thank you in advance.
#include<stdio.h>
#include<string.h>
void test(char *c)
{
// how can i get a from test function.
}
int main(void)
{
char a = 'a' ;
char *b = &a;
test(&b);
}