Thanks for the help guys, I've made some changes and the code now works fine.
While I'm happy that the code works fine, I still feel as if the code isn't really as 'tight' as it could be. I've done quite a bit of work with VB, and to my mind it just seems as if this code is still a bit sloppy and could be more efficient.
It could just be my uneducated eye, but as a beginning programmer I would appreciate any feed back you could give on the structure of my code, or any things that could be improved, even minor little things.
Code:
void Create_New_Excavation_File ( void )
{
/* Constants */
FILE *fp;
/* Variables */
char filename[21];
char path[36] = "C:\\path to folder ";
char file_extension[5] = ".txt\0";
/* Get the file name */
puts( "Please enter an appropriate name for the new file you wish to create.\n(Maximum 20 characters)" );
scanf ( "%20s", filename );
strcat ( path, filename );
printf( "\nCreating File %s.....\n", filename );
strcat ( path, file_extension );
printf( "%s", path );
fp = fopen ( path , "a" );
fprintf ( fp, "\n line of text ." );
fclose ( fp );
}
thanks guys