.front() method returns the next element within the queue. This will be the oldest element of the queue or the element which was added the earliest.
.front() method can be called on a queue using the following syntax:
The following codebyte example calls the
.front() method on the
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
Learn C++ on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification