Created
January 30, 2023 18:45
-
-
Save pavly-gerges/35c9bebac86c191215052d377480fd24 to your computer and use it in GitHub Desktop.
Constant pointer to constant data example
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> | |
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