Insert values in queue - c++ program, C/C++ Programming

Insert values in queue - C++ program:

Write a program to insert values in queue.

int main()

 

{

 

 

    int k;

    Queue timeLine;

    cout << "\nSampling";

    for( int i = 0; i < 7; i++ )

                {

                struct time snapShot;

                gettime( &snapShot );

                Time sample( snapShot.ti_hour,

                                     snapShot.ti_min,

                                     snapShot.ti_sec,

                                     snapShot.ti_hund );

                timeLine.put ( *(new Time( sample )) );

                cout << ".";

                randomize();

                k = rand();

                for(int j = 0; j < k; ++j )  // Delay loop

                     {

                     cout << "";

                     }

                }

    cout << "\nThe timing samples are:\n\n";

    while( !timeLine.isEmpty() )

                {

                Time& sampleTime = (Time&)timeLine.get();

                cout << sampleTime << "\n";

                delete &sampleTime;

                }

    return 0;

}

Posted Date: 10/19/2012 3:03:40 AM | Location : United States







Related Discussions:- Insert values in queue - c++ program, Assignment Help, Ask Question on Insert values in queue - c++ program, Get Answer, Expert's Help, Insert values in queue - c++ program Discussions

Write discussion on Insert values in queue - c++ program
Your posts are moderated
Related Questions
Just need the answers to the following 3 questions. "NO NEED to write a program compile or run it, do not need it. Just need the answers for the following questions. Example quest

Here is a program that uses an inline function to compute and return the absolute value of its input argument. # include inline int abs(int x) {                  ret

Armed with your function from above, we can do some interesting things. For instance, any pixel where the offsets are both zero is a pit (lower than all surrounding points) .


Implement a menu driven real estate catalogue system that allows users to perform various catalogue maintenance and search tasks.  You are only allowed to use the C programming la

Draw pie chart in c++ program: int main() {                 char cmd;                   cout                 cout                 cmd = toupper(getch());


Unlike C++, other programming languages have associative arrays that allow array indices to be strings instead of just integers. You are to create a template class, SVector, that i

Write a Program that illustrate union declaration? A C program encloses the following union declaration: union id { char color[12]; int size; } shirt, blouse; At this

Binary Options EA for DirectFX and SignalPush Project Description: I want a programmer who will build an EA based on my three types of Binary strategy's using two Indicators.