fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class Example
  5. {
  6. public static void Main()
  7. {
  8. Queue<string> bookCollection = new Queue<string>();
  9.  
  10. bookCollection.Enqueue ("The Black Book");
  11. bookCollection.Enqueue ("The Light we Cannot See");
  12. bookCollection.Enqueue ("The Sun is Also a Star");
  13. bookCollection.Enqueue ("A Man Called Ove");
  14. bookCollection.Enqueue ("A Dog's Purpose: A Novel for Humans");
  15.  
  16. // Print the breeds in my Queue
  17. Console.WriteLine("Here are some of the most popular books on New York Times best sellers list:");
  18. foreach (string books in bookCollection)
  19. {
  20. Console.WriteLine(books);
  21. }
  22. booksCollection.Dequeue ();
  23.  
  24. Console.WriteLine("\nLets get rid of a couple and add some more.");
  25. foreach (string books in booksCollection)
  26. {
  27. Console.WriteLine(books);
  28. }
  29.  
  30.  
  31. Console.Write("\nNumber of books listed above: " + booksCollection.Count);
  32. }
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(22,3): error CS0103: The name `booksCollection' does not exist in the current context
prog.cs(25,34): error CS0103: The name `booksCollection' does not exist in the current context
prog.cs(31,60): error CS0103: The name `booksCollection' does not exist in the current context
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty