size_t Stroka const char const str size_t for str printf return size_t

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
size_t Stroka(const char* const str)
{ size_t j;
for (j=0; *(str+j); ++j)
{
}
//printf("%u\n",j);
return j;
}
size_t StrokaInd(const char* const str, char symb)
{ size_t i;
size_t lg = Stroka(str);
for (i=0; *(str+i); --i)
{
if (*(str-i)==symb)
return i;
}
printf("%u\n",lg);
return -1;
}
int _tmain(int argc, _TCHAR* argv[])
{
//PrintTextDivider();
printf("\"A-02-10\"\\\"Brigada7\"\n");
//size_t i=StrokaP("abcdekrgsekkg", "ekkg");
char i = StrokaInd("abcdef", 'c');
//PrintTextDivider();
printf("%u\n",i);
return 0;
}