1
0
Fork 0

Feedback on ex0.* and ex1.*

This commit is contained in:
Eric-Teunis de Boone 2020-05-06 11:43:09 +02:00
parent e363d023cd
commit 982866a7e6
6 changed files with 47 additions and 21 deletions

View file

@ -39,7 +39,9 @@ char* join(const char* str1 , const char* str2)
char* joinb(const char* str1 , const char* str2)
{
int size = strlen(str1) + strlen(str2) + 1;
// size should be 2 more than required for the strlens to
// incorporate the space and the null byte
int size = strlen(str1) + strlen(str2) + 2;
char* new_str = new char[size];
*new_str = 0;