NEWS: Total Picture Views: 147066 | Total Article Views: 155668 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. How to read a JSON and work with it | 3. PickUpThings with Becker Robot | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

Queue Array C


In this exampe I will be showing you to use a queue.


// this programs read an ineger and store its digits into a queue 
// then prints the digits in reverse order
#include <stdio.h>
// define a symbolic constant to hold the capacity of the queue
#define MaxQ 10

#include <queue.h>

	int n;

	// create an empty queue 
	Queue Q=initQueue();
	printf("Enter a positive integer:");

	// parse n into digits and store these digits into a queue
		enqueue(Q,n%10); // insert a digit of n

	// prints the digits from the queue in reverse order
	printf("\nDigits in reverse order:");
		printf("%d", dequeue(Q));
Attachments: None

Tags: Queue

Total Views: 736

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 02/27/15 and updated on 02/27/15


Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.