I am a C++ newbie and I am working on a program that simulates a phonebook. Now, for the insert operation, function is defined as follows:
void PhoneBook::insert(const string& name, const string& number)
But it still works and inserts the contact as well if I remove the reference symbols. So, I am a little confused here, why do I need them?
void PhoneBook::insert(const string name, const string number)