You know, once, just once, I'd like to see a screen on a TV show showing code that wasn't either keyboard spam, pseudo hackery stuff with tons of slashes, or groups.c
groups.c is the file in the Linux kernel that processes user groups. I think it's the default file that hackertyper.net displays. For whatever reason, perhaps because of hackertyper, and because it's freely available, every single piece of media that needs something that looks hacker-y instantly grabs that exact file.
C has ++, the increment operator and --, the decrement operator.
Most of the time, you'll just see something like i--; on its own row. But you can actually use the 'return value' of i-- wherever you want. But that raises a question, should i-- return the value before or after decrementing? Since either could be useful in different scenarios, there are actually ways to do both.
--i returns the value after decrementing, and i-- returns the value before decrementing.
>= is just greater or equal to.
The effect of that loop is to loop down from the initial value of i to 0.
5
u/[deleted] May 28 '21
Honestly, though, are they supposed to code the actual thing in the fiction that doesn't exist?
57
u/Craft4Cube May 28 '21
Looks like it's https://github.com/yandex/smart/blob/master/kernel/groups.c
15
u/cutecoder May 28 '21
A high-tech version of shoulder surfing – use CCTV cameras to look at laptops and “enhance” any code shown to make it readable to people…
11
u/[deleted] May 28 '21
Haha i almost posted this one, the dangling open while loop at the end gives me anxiety.
7
u/heptadragon May 28 '21
I always allocate at least one indirect block pointer when I watch enhanced optics!
1
u/pellotine May 29 '21
Brutal
0
u/[deleted] May 28 '21
[deleted] — view deleted comment