Начал 10ю Задачу

This commit is contained in:
AZEN-SGG 2024-09-26 22:50:53 +03:00
parent 2e4417c1dc
commit a9a13014bf
3 changed files with 32 additions and 0 deletions

1
10Ex/main.c Normal file
View file

@ -0,0 +1 @@

23
10Ex/tools.c Normal file
View file

@ -0,0 +1,23 @@
#include "tools.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;
}
}

8
10Ex/tools.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef TOOLS
#define TOOLS
#include <stdio.h>
FILE * getFile(void);
#endif