473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

array of function pointers..

aki
Hi all,

can anyone tell me the syntax of declaring a
2D array of function pointers.... and initializing it..

thanks
aki

Apr 3 '07 #1
5 1855
aki wrote:
Hi all,

can anyone tell me the syntax of declaring a
2D array of function pointers.... and initializing it..
Just the same as a 2D array of any other type. Start with a typedef for
the function pointer type.

--
Ian Collins.
Apr 3 '07 #2
aki wrote:
Hi all,

can anyone tell me the syntax of declaring a
2D array of function pointers.... and initializing it..

thanks
aki
return_type (*fcn_array[ dim1 ][ dim2])( arg_list);

Initialize it as you would any other 2d array.
Apr 3 '07 #3
Mark P wrote:
aki wrote:
>Hi all,

can anyone tell me the syntax of declaring a
2D array of function pointers.... and initializing it..

thanks
aki

return_type (*fcn_array[ dim1 ][ dim2])( arg_list);
See why I suggested a typedef :)

--
Ian Collins.
Apr 3 '07 #4
Ian Collins wrote:
Mark P wrote:
>aki wrote:
>>Hi all,

can anyone tell me the syntax of declaring a
2D array of function pointers.... and initializing it..

thanks
aki
return_type (*fcn_array[ dim1 ][ dim2])( arg_list);
See why I suggested a typedef :)
I actually don't find the syntax to be excessively horrid, though maybe
I'm just perverse when it comes to these things. :)

Nonetheless, I agree that a typedef is probably the sensible approach
since in practice the function pointer type is likely to be used elsewhere.
Apr 3 '07 #5
aki
On Apr 3, 11:45 am, Mark P <use...@fall2005REMOVE.fastmailCAPS.fm>
wrote:
Ian Collins wrote:
Mark P wrote:
aki wrote:
>Hi all,
>can anyone tell me the syntax of declaring a
2D array of function pointers.... and initializing it..
>thanks
aki
return_type (*fcn_array[ dim1 ][ dim2])( arg_list);
See why I suggested a typedef :)

I actually don't find the syntax to be excessively horrid, though maybe
I'm just perverse when it comes to these things. :)

Nonetheless, I agree that a typedef is probably the sensible approach
since in practice the function pointer type is likely to be used elsewhere.
thanks i got it...
i have a new question regarding this...

Apr 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
4
by: Isaac | last post by:
Hi mates I want to know a simple program of return array from function ? Do I need to use pointer to return the address of the first element in an array. Isaac
4
by: Simon Schaap | last post by:
Hello, I have encountered a strange problem and I hope you can help me to understand it. What I want to do is to pass an array of chars to a function that will split it up (on every location where...
8
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was...
5
by: Stijn van Dongen | last post by:
A question about void*. I have a hash library where the hash create function accepts functions unsigned (*hash)(const void *a) int (*cmp) (const void *a, const void *b) The insert function...
8
by: Piotrek | last post by:
Hi, Like almost all of beginners I have problem understanding pointers. Please, look at this piece of code, and please explain me why myswap function doesn't work as it's supposed to do, whereas...
6
by: M Turo | last post by:
Hi, I was wondering if anyone can help. I'm want to pre-load a 'table' of function pointers that I can call using a its arrayed index, eg (non c code example) pFunc = func_A; pFunc = func_B;
2
by: StevenChiasson | last post by:
For the record, not a student, just someone attempting to learn C++. Anyway, the problem I'm having right now is the member function detAddress, of object controller. This is more or less, your...
5
by: Immortal Nephi | last post by:
I would like to design an object using class. How can this class contain 10 member functions. Put 10 member functions into member function pointer array. One member function uses switch to call...
33
by: Adam Chapman | last post by:
Hi, Im trying to migrate from programming in Matlab over to C. Im trying to make a simple function to multiply one matrix by the other. I've realised that C can't determine the size of a 2d...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.