#include <stdio.h>
void increment(int* int_pointer);
int main(void)
{
int x = 0;
printf("> \n");
scanf("%d", &x);
// TODO: Call increment with x by reference
increment(&x);
printf("x holds %d\n\n", x);
// TODO: Call increment with x by reference
increment(&x);
printf("x holds %d\n\n", x);
// TODO: Call increment with x by reference
increment(&x);
printf("x holds %d\n\n", x);
return 0;
}
// TODO: Define increment function:
void increment(int* int_pointer)
{
(*int_pointer) ++;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter