![]() |
Array of function pointers in C++
Hi All,
I was trying out a simple program to understand array of function pointers in C++. Code:
#include <iostream>while compiling I am getting this error Code:
[root@localhost example]# g++ fptr.cppThanking you in Advance |
Re: Array of function pointers in C++
You have to make the functions static to be able to take their addresses. This is because of the way object orientation works; if an object doesn't exist, then its functions don't exist either, so to make the functions exist whether or not there is an object in existence then the functions have to be static.
Code:
class a |
Re: Array of function pointers in C++
Hi,
thanks it works now, but as you said if object dosen't exist then function dosen't exist, but I am creating the object Code:
a obj; |
| All times are GMT +5.5. The time now is 07:46. |