C

Saturday, 8 July 2017

Program to demonstrate pointer to function

#include<stdio.h>
main()
{
          void mess();
          void (*ptr)();
          ptr=mess;
          clrscr();
          printf("Address of the function is %d\n",ptr);
          (*ptr)();
}             
      void mess()
      {
          printf("I am in the subprogram\n");

      }

No comments:

Post a Comment

Write a program to draw a circle using mid-point circle drawing algorithm.

#include<iostream.h> #include<graphics.h> #include<conio.h> void drawcircle(int x0, int y0, int r) {         ...