|
|
|
|
C++ dinamikus tömb function pointerrel?? |
|
|
|
|
|
|
|
|
|
Hello!
Ezerféleképpen próbáltam már de sehogysem sikerült..
Statikusan létre tudom hozni a címben említett tömböt:
#include <iostream>
#include <vector>
using namespace std;
int Add(int a, int b){
return a+b;
}
int main()
{
int (*Func[10])(int,int);
Func[5]=Add;
cout << (*Func[5])(1,1);
return 0;
}
Csakhogy ez statikus..Dinamikusan new operátorral hogy lehetne, vagy másképpen létrehozni?
Egyébként vector-al is próbálkoztam, de nem sikerült.
pls help! | |
|
|
|
|
|
|
|
|
|
|
| | |
|