#include#include int main() { std::vector myVector = {1, 2, 3, 4, 5}; int item; int index = 3; myVector.GetEntry(index, item); std::cout << "The item at index " << index << " is: " << item << std::endl; return 0; }
#includeIn this example, we use GetEntry to retrieve the value of the item at index 2 (which should be 3) from a linked list. Note that the LinkedList class has its own implementation of GetEntry.#include "LinkedList.h" int main() { LinkedList myList; for (int i = 1; i <= 5; i++) { myList.Append(i); } int item; int index = 2; myList.GetEntry(index, item); std::cout << "The item at index " << index << " is: " << item << std::endl; return 0; }