Hi all - this is my first post to these forums, and I'm a novice programmer.
I've been working through the book Teach Yourself C++ in 21 days. In one example, the following class declaration appears as a private member of a larger class (called List):
I understand that this ListCell class is used to create the cells of a linked list of integers. What confuses me is the second argument of the constructor. What does the assignment operator (=) in the second argument do? I didn't know the asignment operator had any place in argument lists.Code:class ListCell { public: ListCell( int value, ListCell *cell = 0):val(value), next(cell) {} //why the assignment operator? int val; ListCell * next; }
This is probably some basic syntax issue that I missed along the way. Any help?