Zdravim ,mam nasledujuci kod
#include <stddef.h>
int main(void)
{
char *text = "Hello world!";
char *u1 = text, *u2;
size_t i = 0;
ptrdiff_t diff;
while(text[i]) i++;
u2 = text+i;
diff = u1 - u2;
printf("size_t i = %Iu, ptrdiff_t diff = %Ii\n", i, diff);
return 0;
}
Nerozumiem riadku
u2 = text+i;
Mozem scitat char(string) a size_t?A ešte jedna vec
diff = u1 - u2;
,takto mozem odpocitat 2 stringy aby som zistil rozdiel dlzky tychto stringov?Vďaka :-)