Created
March 25, 2017 16:42
-
-
Save tedwardd/1c200c68487f7ede93cc37fe89b75930 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
#include <stdlib.h> | |
int main() | |
{ | |
int x; | |
int *p; | |
p = (int*)malloc(sizeof(x)); | |
p = &x; | |
scanf( "%d", &x ); | |
printf( "%d\n", *p ); | |
free(p); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd write what I think you're trying to do as: