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:
>>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
>>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.
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?