feladat4 done, needs unit tests

This commit is contained in:
Damimani 2026-10-29 18:11:21 +01:00
parent c0886a6cc7
commit bc87732585
7 changed files with 302 additions and 138 deletions

View file

@ -1,8 +1,30 @@
//Tóth Dániel Mátyás | IFPQYY | V1
//Tóth Dániel Mátyás | IFPQYY | V1
#include "cmydateexception.h"
#include <iostream>
static int CopyStr(char* dest, const char* src, const char* concat = "\0") {
if (dest == nullptr || src == nullptr) {
return -1;
}
int i = 0;
while (src[i] != '\0')
{
dest[i++] = src[i];
}
int j = 0;
while (concat[j] != '\0')
{
dest[i++] = concat[j++];
}
dest[i] = '\0';
return -1;
}
CMyDateException::CMyDateException(const char* s)
{
strncpy(msg, s, sizeof(s));
CopyStr(msg, s);
}
const char* CMyDateException::what() {
return msg;
}