Feedback on ex0.* and ex1.*
This commit is contained in:
parent
e363d023cd
commit
982866a7e6
6 changed files with 47 additions and 21 deletions
|
@ -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;
|
||||
|
|
Reference in a new issue