Сделал задание номер 3 (35)
This commit is contained in:
parent
05ce9de374
commit
f6f440fef3
12 changed files with 138 additions and 0 deletions
23
Third/get_file.c
Normal file
23
Third/get_file.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "get_file.h"
|
||||
|
||||
FILE * getFile(void)
|
||||
{
|
||||
FILE * file;
|
||||
char filename[50];
|
||||
|
||||
printf("Enter filename: ");
|
||||
if (scanf("%s", filename) == 1)
|
||||
{
|
||||
file = fopen(filename, "r");
|
||||
if (file == NULL) {
|
||||
printf("Error file!\n");
|
||||
return NULL;
|
||||
} else {
|
||||
return file;
|
||||
}
|
||||
} else
|
||||
{
|
||||
printf("Empty name!\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue