File: 4fbd423e8f3a28a900bd67376e496e2c0122a4a02184f14bbf22516e19695c62.jpg (dl) (270.04 KiB)
/g/ - Technology
install openbsd
[Make a Post]Hello, Happase
File: 1eb5f5f46588cdb15bd409a4ff18b5e2ba1a457c4a8ffde5f734af75da2b50a9.png (dl) (527.98 KiB)
>>1681
What? Answer my fleurcking question faggot. And no I am not "Happase" whoever this person is.
>>1712
>[ptr].elem
no, my point is that you would get rid of the . syntax and replace it with -> because it's easier to read and looks better, and also frees up the dot as a sigil for anything else you want to use it for. idk it's just my personal preference.
>What about syntax for taking a reference?
just keep it as &
so [&var] would be the same as var
>>2024
>DURR IT SAVES BYTES!!!
-> looks better than . and should replace it. It's not as if the uncompiled source code size matters very much.
>>2024
>1 less char counts
>in the fucking source code
>and reduces readability to boot
You Have Autism
File: 0d9873937388c493f3c9b607b6dd5a84a17a0a88321565a84f6b85658b216274.png (dl) (109.14 KiB)
>>2041
>MUH COLUMNS MUH SKREEN
Do yourself a favor and code yourself a nice 640x480 console driver which has over 80cols, nigger. Terry Davis did it, so can you.
>No.
Yes.
[Catalog][Overboard][Update]
[Reply]14 replies
As we all know (hopefully), pointer dereferencing in C can be done in one of three ways.
*ptr or 0[ptr]
ptr[9]
ptr->elem
Why can't we just unify those three methods into one, using brackets just like in (nasm syntax) assembly? It would be just like if the 0 in 0[ptr] could be omitted by default. The dot syntax for struct field access could be replaced by -> (just because it looks better imo). So those three operations could be written as:
[ptr]
[ptr+9]
[ptr]->elem
Anyone have a problem with this?