1. Use constants with reference when passing values in between methods.
Advantage: It will reduce space and will be faster. If you use a new variable then an additional copy is made and there is a small memory hit.
Ex: method(string val)
optimal usage: method(const string &val)
Here we are passing the value by reference.
Leave a Reply