For example, assuming a string s is this:
string s
for(int x = 0; x < s.length(); x++)
better than this?:
int length
Is s.length() inline and returns a member variable? then no, otherwise cost of dereferencing and putting stuff in stack, you know all the overheads of function call you will incur for each iteration.