Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Queues > 10.8 INITIALIZING THE QUEUE WITH A CONSTRUCTOR METHOD

10.8 INITIALIZING THE QUEUE WITH A CONSTRUCTOR METHOD

We can now set about creating the class and writing its member functions based upon the designs discussed in Sections 10.7.1 to 10.7.6. For the example, we will take items to be integer values. You may create your own version for other data types, such as character strings for example.

So as to allow for queues of different sizes, we will pass a parameter to the method as shown in Listing 10.3.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint