Try to keep control of what you're passing between the different functions:
Code:
void getLen(kata L)
{
int i=0;
while(L.TKata[i ] != '\0')
{i++;}
L.len = i-1;
}
Here you're passing a copy of kata, not the object itself, so any assignment of L.len is lost on exit of function scope.
Code:
void getLen(kata* L)
{
int i=0;
while(L->TKata[i ] != '\0')
{i++;}
L->len = i-1;
}
....
getLen(&v);
will do, what you possibly want here, where the len member of the passed kata is assigned the length (altho you're off by one)
When copying, you need to think in the same direction.
Altho your code does what it should do, theres way too much pointer to pointer arritmetic in it for my taste, instead you can use
Code:
void CopyKata (kata* Tin , kata *Tout)
{
int i;
Tout->len = Tin->len;
for (i = 1; i < (Tin->len +1);i++)
{
Tout->TKata[i ] = Tin->TKata[i ];
}
}
...
CopyKata(&Input, &T.TFile[1]);
CopyKata(&T.TFile[1], &T.TFile[2]);
Another thing, I dont like the
SetFile() you're using, when passing
Tab T to it, you're relying on the usual pass by value effect to handle everything you've put into the Tab struct.
A better way here, would be to use pass by reference aswell.