#include <stdio.h>
void add_one(int q[]) {
// because 'q' is just a special kind of pointer
// called a constant pointer, this statement works
// as you would expect.
*q = *q + 1;
}
int main() {
int a = 10;
add_one(&a);
// print the updated value.
printf("%d\n", a);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: