*f = "01234567", *pos, *tpos;
pos = strchr(f, '3');
tpos = strchr(f, '5');
if (pos < tpos) puts("pos is first");
so i'm doing like this
is it ok?
do this first on stack then on heap. stack: pos < tpos heap: pos > tpos
before doing if(pos < tpos) add a if(pos != NULL && tpos != NULL)
Обсуждают сегодня