Hi there, anyone can explain me, why this parts of code are acting differently?
while((c = fread(buf, sizeof(char), 1, f)) != 0);
{
if(write(t, buf, c) < 0)
{
return E_MSGSEND;
}
}
/////////////////////////////////////
do
{
c = fread(buf, sizeof(char), 1, f);
if(write(t, buf, c) < 0)
{
return E_MSGSEND;
}
} while(c != 0);
while {} runs only 1time but do {} while 5times. Whats is the difference? Before while {} c is intialized to 1.
Thanks an advice