Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years ago.
How can I use lambda functions for callbacks?
There is my code
There is my code
pcContr.addCommand('q', []() {
printf("WORKS!");
});
void ControllerPC::addCommand(char command, Callback<void()> cb)
{
cbCommand[commCount] = command;
cbArr[commCount] = cb;
commCount++;
}
Maybe someone can advice me a better way to make this...