Okay guys who's answering "x" come on :')
-
-
-
Solution here for the curious:https://twitter.com/MeBeiM/status/1220421548273737731 …
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
-
-
Seems to be some putchar() magic going on. When I replaced putchar() with write() it did what I thought it would do ("xx"). Love these C pop up quiz questions :)
-
All stdio function have a little bit of that *magic* behind :) using raw syscalls of course gets around that, although it's usually not advisable.
- Još 2 druga odgovora
Novi razgovor -
-
-
Doesn't this depend on whether it's buffered or not?
-
Indeed it does
Kraj razgovora
Novi razgovor -
-
-
My guess is that this is going to print xxxx because glibc does line buffering by default. You end up with 4 processes each having 'x' in their stdout buffer which is only flushed at exit. Correct?
-
Nice read, that's indeed right :)
Kraj razgovora
Novi razgovor -
-
-
Awesome! I wonder if there are any OS settings that will disable buffering without modifying execution command?
-
Well, probably not OS settings, but there's the `stdbuf` command line tool https://linux.die.net/man/1/stdbuf
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.