Stupid things C-""""programmers"""" do

i'll start
struct some_struct_s
{
long variable_0;
long variable_1;
long variable_2;
long variable_3;
long variable_4;
long variable_5;
};

struct some_struct_s some_struct[10];

for (int k = 0; k < 10; ++k)
{
for (int l = 0; l < 6; ++l)
{
*(long *)((long)&some_struct[k] + (l * sizeof(long))) = l;
}
}

Attached: 1524866867678.png (448x308, 201K)

Other urls found in this thread:

cdecl.org/
twitter.com/NSFWRedditImage

C is unreadable

>hurr look at me abusing syntax
>stupid programmers
it's you

let a = 1;

>abusing syntax
im not though, am i
this is a quick method of initializing variable_0-5 to 0-5 for all elements in the structure array where all elements are of equal size and need to be accessible uniquely, instead of using enums for indexing array or some other method

this is how it works under the hood regardless javeesh
except you can do more stuff if you actually are given tools to manipulate memory

!!a

You clearly don't write code for money. Shit like this is what neckbeards write in their mom's basement because nobody has to ever read it again because of "muh elegance" and "muh shortness of code". Any sensible programmer would just write it into a function or as multi-line initialization.

Nobody writes C like that.

stop posting this all over again