I am very new to C.
Could you, please, point me out what part of my code (function, some of the operators, wrong strings declaration, etc) is making the following output in console:
I expect to have OmelianLevkovych.
The following code snippet:
#include <stdio.h>
#include <stdlib.h>
const char* GetFullName(char firstName[], char lastName[])
{
return strcat(firstName, lastName);
}
int main()
{
char firstName[] = "Omelian";
char lastName[] = "Levkovych";
char* fullName;
fullName = GetFullName(firstName, lastName);
printf("%s", fullName);
return 0;
}
I am using Code.Block IDE 20.03 (default hello-world template proj).