Computer scienceProgramming languagesC++Introduction to STL (Containers and Algorithms)

Basic algorithms of STL

Theory

Task queue

Report a typo

You want to create a simple task queue where tasks are processed in the order they are added. Complete the below code in C++ to achieve the desired results.

Fill in the gaps with the relevant elements
#include <iostream>
#include <queue>

int main() {
    <std::string> taskQueue;

    taskQueue.push("Task 1");
    taskQueue.push("Task 2");
    taskQueue.push("Task 3");

    while (!taskQueue.) {
        std::cout << "Processing: " <<  << std::endl;
        ;
    }

    return 0;
}

Create a free account to access the full topic