My question is, that why does it print out hahahihihuhu / all the strings I added to different indexes?
5 characters (do not forget the terminating zero of the string literal) is copied to bla that has type char. So the fifth character that is '\0' will be copyed in bla.
is the same problem. Only the bla that contains '\0' will be overwritten by the first character of the string literal. The terminating zero will be written beyond the array.
you are overwriting the memory that does not belong to the array because the array has acceptable indexes in the range [0, 1].. Again you are overwriting the last terminating zero of the previous operastion.
So you get one long string which occupies the memory beyond the array. The type of the expression b is char. So then you use