#include<stdio.h>
#include<conio.h>
int fun(int,int);
typedef int(*pf)(int,int);
int proc(pf,int,int);

void main()
{
	printf("%d",proc(fun,6,6));
	return 0;
}
int fun(int a,int b)
{
	return(a==b);
}

int proc(pf p,int a,int b)
{
	return((*p)(a,b));
}

ans= 1

Recommended Answers

All 2 Replies

Welcome to this forum, tangent03.
Could you please check out this page, and add code tags to your future posts?

Also, don't use void main() , it's evil.
Instead change it to int main() .

Don't use un-standard libraries such as conio.h, certainly not when you're not using any function from it.
(Remove: #include<conio.h> from your code)

>can anyone explain me how dis code is working
Yes, but it's maybe better that you tell us first how you think the code works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.