What is the point of this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the point of this?

Recently I saw one question during challenges wherin there is a 2x2 matrix and you try to print this way int mat[2][2] ={{1,2}{4,5}}; cout << 0[1[mat]] ; output is : 4 it outputs the element (1(0)) EDIT : please redirect me to any documentation to know what is this even called!

24th Nov 2020, 12:42 PM
Saithama
2 Answers
+ 1
Coder Kitten Thanks for this beautiful answer, I was literally tired of searching this everywhere!
24th Nov 2020, 1:10 PM
Saithama
0
NotAPythonNinja obviously it would work with N dimentional array Coder Kitten has already explained about the subscript expression. I wonder how many such secret hidden side effects exist, imagine one system tomorrow which is an AI doing some critical stuff and this side effect causes AI to finish off the human race lol.
24th Nov 2020, 4:23 PM
Saithama