Synopsys interview question

implement string.size() in C++