I know how to have a linked list in c++ and use add method to input entries by entries. However, I do not want to add entries by entries. Is there a way to declare a linkedlist with initial values in the list?
For example, if I want to have {1, 2 , 3 , 4, 5} and as many elements as i want in the list is there something I can do in one line? Something like:
LinkedList<int> list = new LinkedList<int>(1,2,3,4,5);