Search
 
SCRIPT & CODE EXAMPLE
 

CPP

print queue c++

#include <queue>
#include <iostream>

void print_queue(std::queue q)
{
  while (!q.empty())
  {
    std::cout << q.front() << " ";
    q.pop();
  }
  std::cout << std::endl;
}

int main()
{
  std::queue<int> q;
  for (auto i : {1,2,3,7,4,9,7,2,4}) q.push(i);
  print_queue(q);
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: sort in descending order c++ stl 
Cpp :: how to get the player view point location and rotation in ue4 c++ 
Cpp :: c++ remove whitespace from string 
Cpp :: cannot find -lsqlite3 C++ compiler error 
Cpp :: xmake set binary name 
Cpp :: qt qstring to double 
Cpp :: BMI Calculator Program in C++ 
Cpp :: PI IN C++ WITH CMATH 
Cpp :: c++ get last character of string 
Cpp :: c++ vector add only unique elements 
Cpp :: how to free the vector c++ 
Cpp :: remove element from vector on condition c++ 
Cpp :: easy c++ code 
Cpp :: fork c 
Cpp :: 2d array using vector 
Cpp :: cpp split string by space 
Cpp :: c++ kruskal algorithm 
Cpp :: what is the short cut way to find the max and min element in an array in c++ 
Cpp :: default access modifier in c++ 
Cpp :: how to copy one vector to another 
Cpp :: fiunction in c++ 
Cpp :: random number cpp 
Cpp :: print vector of vector c++ 
Cpp :: random number of 0 or 1 c++ 
Cpp :: How to reverse a string in c++ using reverse function 
Cpp :: c++ vector pop_back 
Cpp :: initialize 2d vector 
Cpp :: print 2d array c++ 
Cpp :: divide and conquer based algorithm to find maximum and minimum of an array 
Cpp :: stoi cpp 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =