This is my code (with debug prints):
char *full_file_name = malloc(sizeof(char));
FILE *ob_file;
/*creating full file name*/
strcpy(full_file_name, file_name);
strcat(full_file_name, ".ob");
printf("\n full_file_name :%s", full_file_name);
/* -- Creating the new file and inputting data --*/
ob_file = fopen(full_file_name, "w");
printf("\n full_file_name :%s", full_file_name);
Why is this happening? What to do?

You’re only allocating memory for a single char. (You should check for
NULLafter malloc, too, btw)