titbits from the world less travelled

Tip 1: Optimize code to run faster

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.

posted by admin in c++ and have No Comments

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment