Home

A program to explain FUNCTION with RETURN TYPE POINTERS

C Programming Language 109

Program

#include <stdio.h>

int *fun()
{
    int j = 15;
    return (&j);
}

void main()
{
    int *b;
    b = fun();
    printf("b = %d", *b);

    printf("\n");
}

Result

The above code is probably incorrect. Please comment below how that can be fixed.


Last Updated on

Next Post: GraphProtocol: TS2322 null assignment in Subgraph →

Comments