Function pointer

Program:

#include<stdio.h>
void fun(int a)
{
    printf("The value of a is %d",a);
}
int main()
{
    void (*ptr)(int);
    ptr=&fun;
    (*ptr)(20);
}


output:

The value of a is 20                                                                                                                           
                    

Comments

Popular posts from this blog

c++ program to print string along the diagonals of the matrix.

Kollywood Game

C program to print the following Pattern