Skip to content

Instantly share code, notes, and snippets.

@Kadajett
Created July 11, 2019 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kadajett/f2e4b45482a3de3d0b3b0a526ada07c3 to your computer and use it in GitHub Desktop.
Save Kadajett/f2e4b45482a3de3d0b3b0a526ada07c3 to your computer and use it in GitHub Desktop.
#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