A few pointers then:
>>scanf ( "%20s", filename );
The FAQ link I posted tries to get people to avoid scanf() for reading strings from the keyboard.
/* Constants */
is not appropriate, as there are no constants.
>>char file_extension = ".txt\0";
The \0 is not needed, it's added by the compiler.
>>fp = fopen ( path , "a" );
Mode "a" doesn't create a new file, like your function name suggests. Either make it mode "w" or change the function name.
As for the size of the filename array, you can use the constant FILENAME_MAX like so:
Another way to achieve a similar result (one of many):
const char path = "C:\\Directory";
const char file_extension = ".txt";
char input[FILENAME_MAX - sizeof(path) - sizeof(file_extension)];
puts("Please enter an appropriate name for the new file you wish to create.\n"
"(Maximum 20 characters)");
if (fgets(input, sizeof(input), stdin) != NULL)
char *p = strchr(input, '\n');
if (p) *p = '\0';
sprintf(fullname, "%s\\%s%s", path, input, file_extension);
printf("\nCreating File %s.....\n", fullname);
if ((fp = fopen(fullname, "w")) == NULL)
fprintf(fp, "\n line of text .");