Invoking a function through function pointer
- From: ravikumar.n@xxxxxxxxxxxxxxxx (Ravi kumar.N)
- Date: 25 Apr 2005 00:13:57 -0700
Respected Experts,
Iam Ravikumar.N, I have a query regarding
pointer to a function. I have a sample code, it is as follows
void func(int x, int y)
{
cout << x << "\n";
cout << y << "\n";
}
void main()
{
void (*fp)(int, int);
fp = func;
(*fp)(10, 20); //One way of invoking the function
fp(10, 20); //Another way of invoking the function
}
The above code reveals that the function "func" can be invoked in
two ways
i.e. 1)(*fp)(10, 20);
2) fp(10, 20);
I would like to know what is the difference between in these two
invocations.
With Regards
Ravi Kumar.N
.
- Follow-Ups:
- Re: Invoking a function through function pointer
- From: Andrey Tarasevich
- Re: Invoking a function through function pointer
- From: Chris Dollin
- Re: Invoking a function through function pointer
- Prev by Date: Re: programming job market in bay area in US
- Next by Date: Re: Throwing Exceptions
- Previous by thread: problem in connecting sql server
- Next by thread: Re: Invoking a function through function pointer
- Index(es):
Relevant Pages
|