Creating a new array of poiters to functions.

This is a discussion on Creating a new array of poiters to functions. within the C++ Programming forums, part of the General Programming Boards category; Hi Im trying to create a new array of pointers to functions, ive tried many things including this: Code: bool ...

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    116

    Creating a new array of poiters to functions.

    Hi

    Im trying to create a new array of pointers to functions, ive tried many things including this:

    Code:
    bool (**temp)() = new bool (*[arrSize + 1])();
    but it doesnt work, :\

    can anyone explain to me what am i doing wrong??

    tks

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,635
    Typedef the function pointer type, and then it will be easy. Also, use std::vector for a dynamic array.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    116
    Ok tks for the help, i forgot typecasts lol

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. An array of macro functions?
    By someprogr in forum C Programming
    Replies: 6
    Last Post: 01-28-2009, 06:05 PM
  3. Creating an array of pointers to int[]
    By OkashiiKen in forum C Programming
    Replies: 3
    Last Post: 09-29-2006, 06:48 PM
  4. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM
  5. Creating an array of object pointers
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-08-2001, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21