Начал 10ю Задачу
This commit is contained in:
parent
2e4417c1dc
commit
a9a13014bf
3 changed files with 32 additions and 0 deletions
1
10Ex/main.c
Normal file
1
10Ex/main.c
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
23
10Ex/tools.c
Normal file
23
10Ex/tools.c
Normal 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
8
10Ex/tools.h
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef TOOLS
|
||||||
|
#define TOOLS
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
FILE * getFile(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Add table
Add a link
Reference in a new issue