Im trying to write a simple function that get name and return it after adding an extension to it. for example, if i have the char pointer to "abcd" the function should return "abcd.as"
I tried to write this function that get char pointer and return a pointer to a new char after adding the extension. But is not working does someone know why?
char* AddFileExtension(char* FileName)
{
char* FixFileName=NULL;
char* Extension = ".as";
strcpy(FixFileName, FileName);
strcat(FixFileName, Extension);
return FixFileName;
}