Oh and this is a little off topic but whats the difference between a pointer and a reference? I know the syntax is different but how do they perform differently and when should I use one over the other?
You'll get many differing opinions about when to use one over the other.
Mine is to use references (const or non-const) when possible. The exception to the case is when a function could, under normal working scenarios, be passed a NULL pointer. You can't (easily) pass NULL references.
So as examples, a function that sorts a list should take the list by non-const reference, unless you really intend to allow the user to pass a NULL pointer and do something other than return an error code or seg fault. A function that prints the contents of a list should take the list by const reference, unless again, you want to do something other than return an error or seg fault.
A pointer stores basically the memory location of a variable while a reference is simply an alternate name of an existing variable.
References are usually used in function calls while pointers have much diverse applications. But use them with care or you could end up crashing your system.