Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / Pract. 07 / Solutions / my_strcat.cpp
blob: 49d2d2e501e412616027472d19391931c1fa7c97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
//If destination has enough space
void my_strcat(char* dest, const char* source)
{
	size_t destLength = my_strlen(dest);
	size_t sourceLength = my_strlen(source);

	for (size_t i = 0; i < sourceLength; i++)
	{
		dest[destLength + i] = source[i];
	}
	dest[destLength + sourceLength] = '\0';
}