Hello, the code below functions properly, the output is 23. And yet I’m confused why it doesn’t output the same result (the output stays 22) when I increment the Pointer by writing *agePointer++; instead of *agePointer += 1;
Doesn’t the code mean the exact same thing? Thx in advance Image may be NSFW.
Clik here to view.
void incrementAge(int *agePointer){
*agePointer += 1;
}
int main(void) {
int age = 22;
incrementAge(&age);
printf("%d\n", age);
}
2 posts - 2 participants