R
raj_rohit10
Guest
Poniżej podane drukuje tylko hello-kod błędu pewnego czasu potem masowe wydruki hello-out ...
co jest powodem tego? Jeżeli dodaję \ n w fprintf wtedy działa dobrze ...
# include <stdio.h>
# include <unistd.h>
int main ()
(
while (1)
(
fprintf (stdout, "hello-out");
printf ( "hello-err");
sleep (1);
)
return 0;
)
Wyjście z tego kodu jest Solaris Sparc Machine: hello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-out
Chociaż jak na c należy: hello-outhello-errhello-outhello-errhello-outhello-errhello-outhello-er ...
dzięki za odpowiedź z góry
Rohit Raj
co jest powodem tego? Jeżeli dodaję \ n w fprintf wtedy działa dobrze ...
# include <stdio.h>
# include <unistd.h>
int main ()
(
while (1)
(
fprintf (stdout, "hello-out");
printf ( "hello-err");
sleep (1);
)
return 0;
)
Wyjście z tego kodu jest Solaris Sparc Machine: hello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello-errhello -
errhello-errhello-errhello-errhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello-outhello -
outhello-outhello-out
Chociaż jak na c należy: hello-outhello-errhello-outhello-errhello-outhello-errhello-outhello-er ...
dzięki za odpowiedź z góry
Rohit Raj