README.md

December 5, 2022 ยท View on GitHub

a pointer example

Description

Demonstrates a simple example of a pointer in C.

More Info

Submitted On
ByDr. Apache
LevelBeginner
User Rating4.4 (31 globes from 7 users)
CompatibilityC
CategoryData Structures
WorldC / 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;
}