Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:21:11+00:00 2026-06-03T20:21:11+00:00

I am attempting to make an array of function pointers. The array is going

  • 0

I am attempting to make an array of function pointers.

The array is going to be of quite a few functions (between 10 and 50 somewhere).

This declaration is similar to the one I’m using:

int (*functions[15])(int, int);

The issue I am encountering is that I will have to define all of these functions by hand. This is fine; however I do not care to give a name to all of them.

None of the functions that will be in the array will be called from outside of the array.

I know I’m pushing my luck with this question, but is there a way for me to put anonymous functions (similar to delegates, I suppose) into this array?

or could I use a declaration similar to this:

int (*functions[15])(int, int);

(*function[0])(int x, int y)
{
    //stuff
}

(*function[1])(int x, int y)
{
    //other stuff
}

I hope to avoid using any C++11 with this, as well, if possible; I understand a lot of improvements have been made with it, but I don’t know if all compilers would support it yet (I intend on using multiple compilers across platforms).

Is there a way to do this without naming every single function, or am I out of luck?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:21:13+00:00Added an answer on June 3, 2026 at 8:21 pm

    Without anonymous functions, you need to name your functions. There’s no alternative in pre C++11.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Language: Visual C++, MFC I'm attempting to make an array of pointers to CString
I'm attempting to make a StateMachine execute some database action between states. So I
I just started working with jqGrid this week. I'm attempting to make a generic
I am attempting to make a program that will input numbers into an array
I have had many attempts now on attempting to make this work and i
I'm attempting to make an array of users with ids and data. Normally the
I am attempting to make a struct with a 2D array in it to
I am attempting to use a recursive function to search through a multidimensional array,
I'm trying to make the DefaultValueAttribute value dynamic, and this is how I'm attempting
I'm attempting to read values from a 2-dimensional array and multiply them to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.