Skip to content

Instantly share code, notes, and snippets.

@pavly-gerges
Created January 30, 2023 18:45
Show Gist options
  • Save pavly-gerges/35c9bebac86c191215052d377480fd24 to your computer and use it in GitHub Desktop.
Save pavly-gerges/35c9bebac86c191215052d377480fd24 to your computer and use it in GitHub Desktop.
Constant pointer to constant data example
#include <stdio.h>
int main(void) {
int x = 8; // define x
int y; // define y
// constant pointer to constant data
const int* const ptr = &x;
printf("%d\n", x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment