Created
June 27, 2012 14:40
-
-
Save McPolemic/3004483 to your computer and use it in GitHub Desktop.
Modify by reference example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void modify_short(short *value) | |
{ | |
*value = 3; | |
} | |
int main(int argc, char *argv[]) { | |
short temp = 2; | |
modify_short(&temp); | |
printf("Value of short: %hd\n", temp); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment