2026-27-cpp-homework/feladat4/feladat4/cmydateexception.cpp
2026-10-29 18:11:21 +01:00

30 lines
504 B
C++

//Tóth Dániel Mátyás | IFPQYY | V1
#include "cmydateexception.h"
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)
{
CopyStr(msg, s);
}
const char* CMyDateException::what() {
return msg;
}