Created
July 11, 2019 20:53
-
-
Save Kadajett/f2e4b45482a3de3d0b3b0a526ada07c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <array> | |
using namespace std; | |
struct QueueItem { | |
int func(string); | |
string params; | |
}; | |
int testFunc1 (string param) { | |
cout << param << " testFunc1"; | |
return 0; | |
} | |
int testFunc2 (string param) { | |
cout << param << " testFunc2"; | |
return 0; | |
} | |
int testFunc3 (string param) { | |
cout << param << " testFunc3"; | |
return 0; | |
} | |
int main () { | |
array<QueueItem,3> queue; | |
queue[1].func = testFunc2; | |
queue[1].params = "wert"; | |
queue[2].func = testFunc3; | |
queue[2].params = "kjgh"; | |
int queueSize = queue.size(); | |
for (size_t i = 0; i < queue.size(); i++) | |
{ | |
queue[i].func(queue[i].params); | |
} | |
cout << "Hello World"; | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment