aboutsummaryrefslogtreecommitdiff
path: root/week11/Exercise04/Street.cpp
blob: 8cc6905b30004d7a83cf993802850a00218bbde2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "Street.h"

unsigned numberLength(unsigned num) {
	if (num == 0) return 1;

	unsigned len = 0;
	while (num != 0) {
		len++;
		num /= 10;
	}

	return len;
}

unsigned Street::Length() {
	return String::Length() + numberLength(streetNumber);
}