Ahoj. Mam problem - tvorim linuxovou aplikaci v jazyce C a potrebuji fci, ktera by cetla text(mmaped file) az k urcite hranici a pocitala by radky. Napsal jsem to takhle:
unsigned int
row_count(const char *string, const size_t len)
{
unsigned int count = 0;
char *tmp;
tmp = string;
while (((tmp = strstr(tmp, "\n")) != NULL) && (tmp-string < len))
++count;
return (count);
}
Ale prelozit to nejde, (warning: assignment discards qualifiers from pointer target type) - poradite mi nekdo, co s tim?