I am a newbie in the C language and learning it. I am learning the pointers. I am confused a little about the following program.
My question is it even possible to get the outcome B ever? I am changing the value of a but accordingly, the value of b gets changed due to the pointer and I am always just getting outcome A. How can I get outcome B? Any help will be really appreciated. Thanks :)
#include <stdio.h>
void increment(int value) {
value++;
}
int main() {
int a = 6;
int *b = &a;
increment(a);
if(a == *b) {
printf("outcome A");
} else if(a > *b) {
printf("outcome B");
} else {
printf("outcome C");
} return 0;
}