[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

index[array] is identical to array[index]

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 20
Thread images: 3

File: giphy.gif (494KB, 200x200px) Image search: [Google]
giphy.gif
494KB, 200x200px
>>
>using arrays
>>
>>62182796
address+[offset] is the same as [offset]+address? It's almost like that thing these mathematicians were talking about https://en.wikipedia.org/wiki/Commutative_property
>>
File: file.png (311KB, 600x751px) Image search: [Google]
file.png
311KB, 600x751px
>>62183069
>>
Does this work with multi dimensional arrays?
>>
>>62182796
>>62183069


But why is it
i[array] = 42;

then?

Shouldn't it be
[i]array = 42;

???
>>
>>62183986

Meh, bad wording..

Normal:
myArr[i] = 0;

Funky way:
i[myArr] = 0;


But why isn't it:
[i]myArr = 0;

?
>>
>>62184028
because that's not how subscripts work
>>
>>62184040

So "x[y]" is bascially the operation "x+y"?

I see..
>>
>>62184062
No, it's the operation *(x+y)
>>
>>62184076

Yeah, sorry for the interpunctuation.

still learning asm..
>>
File: giphy.gif (811KB, 360x203px) Image search: [Google]
giphy.gif
811KB, 360x203px
>>62184076
>>
>>62184199
Source?
>>
>>62182796
specify the language you're writing in next time, nigga
>>
>>62185900
It may be strange but I knew what he meant without additional explanations, I didn't even notice that he didn't mention the language.
>>
>>62185997
C is the only language which is so retarded
>>
>>62186079
I don't find it retarded. It actually makes sense once you know the technical background such as memory mapping and memory layout.
>>
>>62186216
C has no awareness of memory mapping. C predates memory segmentation.
>>
>>62186216
>it makes sense if you know why that is
Yeah, same as ("2" + 1 == 21) making sense in JS if you know why it happens. Doesn't mean that it isn't retarded though.
(Note: example might not be true.)
>>
>>62186288
It's a slightly different kind of example, C is on a lower level than JS and the majority of its limitations and quirks are due to the underlying hardware. Any variable is actually just an address to a some location in the virtual memory.
Thread posts: 20
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.