Skip to content

Instantly share code, notes, and snippets.

@pdaug
Created May 27, 2024 11:33
Show Gist options
  • Select an option

  • Save pdaug/724e84b9a8ffb0dae058a69f6057340a to your computer and use it in GitHub Desktop.

Select an option

Save pdaug/724e84b9a8ffb0dae058a69f6057340a to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
int favNumber = 8;
int *pointerFavNumber;
// below it is save the variable address
pointerFavNumber = &favNumber;
// print the pointer address
printf("address: %p", pointerFavNumber);
printf("\n");
// print the value of the pointer address
printf("value: %d", *pointerFavNumber);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment