lemmysmash

joined 3 months ago
[–] lemmysmash@piefed.social 15 points 2 days ago (3 children)
[–] lemmysmash@piefed.social 4 points 2 days ago (1 children)

Ha, peasant! They're not here to give you options, they're here to make you watch more of the stupid garbage and click on more ads.

[–] lemmysmash@piefed.social 2 points 4 days ago (3 children)

What about Uranium? How expensive is that?

[–] lemmysmash@piefed.social 1 points 4 days ago (1 children)

Does it really NOT allow downloads/exports of the GPX/route files? Or am I just stupid?

[–] lemmysmash@piefed.social 1 points 4 days ago (10 children)

Are there already any uncesored models based on it? Asking for a friend...

[–] lemmysmash@piefed.social 3 points 4 days ago (1 children)

Why would you have an account there in the first place?

[–] lemmysmash@piefed.social 5 points 1 week ago* (last edited 1 week ago) (1 children)

I'm too lazy to confirm, but I think scanf (as well as many other I/O functions) works on top of the buffered input. I.e. when you scanned only one character on the first run of scanf but there are more left in the buffer, then subsequent calls will read from that buffer, e.g.

printf("your prompt>")
/* you type 123 */
/* buffer contains: "123" */
scanf(...)
/* you scanned 1 char ("1") */
/* buffer contains: "23" */
printf("new prompt>");
/* the prompt has been printed AFTER your previous input but the buffer hasn't been reset! */
/* buffer contains: "23" */
/* you type 456 */
/* buffer contains: "23456" */
scanf(...)
/* scanf returns "2" */
/* buffer contains: "3456" */

In general you have two options:

  1. drain the buffer after / before each loop cycle
  2. use unbuffered I/O

For both cases, do your research on how to do it :) That K&R from above should be a great start indeed.