Home

A program to declare a POINTER and to explain the initialization of pointer

C Programming Language 099

Program

#include <stdio.h>

void main()
{
    int a, *p;
    p = &a;
    printf("Enter a number: ");
    scanf("%d", p);

    printf("a = %d", a);
    printf("\n");
}

Result

Enter a number: 123
a = 123


Last Updated on

Next Post: GraphProtocol: TS2322 null assignment in Subgraph →

Comments