Commit 467dcd5b by trkall

esimene kodut66

parent 7a22791b
No preview for this file type
#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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment