README.md
December 5, 2022 ยท View on GitHub
Description
Demonstrates a simple example of a pointer in C.
More Info
| Submitted On | |
| By | Dr. Apache |
| Level | Beginner |
| User Rating | 4.4 (31 globes from 7 users) |
| Compatibility | C |
| Category | Data Structures |
| World | C / C++ |
| Archive File |
API Declarations
<stdio.h>
Source Code
#include <stdio.h>
int i = 1;
/* declare a pointer to i */
int *p;
int main()
{
p = &i; /* Tell p to point to i */
printf("\nIf you access the integer directly...... i = %d", i);
printf("\nIf you access via the pointer or indirectly...... i = %d", *p);
printf("\nThe address of the integer is %d", &i);
printf("\nAddress the pointer points to is %d\n", p);
return 0;
}