Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
trkall
/
iag0582
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
467dcd5b
authored
Mar 01, 2017
by
trkall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esimene kodut66
parent
7a22791b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 additions
and
28 deletions
praktikum 2.2/F2.txt
praktikum 2.2/esimeneKT.o
praktikum 2.2/functions.c
praktikum 2.2/F2.txt
View file @
467dcd5b
No preview for this file type
praktikum 2.2/esimeneKT.o
View file @
467dcd5b
No preview for this file type
praktikum 2.2/functions.c
View file @
467dcd5b
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef
struct
// https://www.tutorialspoint.com/cprogramming/c_structures.htm
typedef
struct
{
char
Nimi
[
50
];
char
Liik
[
50
];
...
...
@@ -34,26 +30,3 @@ int chkFile(FILE *andmed)
return
1
;
}
char
*
kontroll
(
char
*
filename
)
{
printf
(
"Sisestage sorteeritava faili nimi:
\n
"
);
scanf
(
"%s"
,
filename
);
int
pikkus
;
int
i
;
int
j
=
4
;
int
cmp
;
char
str
[
5
];
char
str1
[
5
]
=
".txt"
;
pikkus
=
strlen
(
filename
);
for
(
i
=
0
;
i
<
5
;
i
++
)
{
str
[
j
]
=
*
(
filename
+
(
pikkus
-
i
));
j
--
;
}
cmp
=
strcmp
(
str1
,
str
);
if
(
cmp
!=
0
)
{
strcat
(
filename
,
str1
);
}
return
filename
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment