[SOLVED] Filling and printing 2D char array (or even array of strings)
I was trying to modify this code to allow users to choose their own characters for drawing the pattern: https://code.sololearn.com/cb9E4EXRq1Lk/?ref=app So I tried to write a piece of code that do the job: https://code.sololearn.com/c4fn2m1zNIy9/?ref=app But it doesn't work. If I input "aa bb cc dd" it prints "aa" instead of "bb" Even changing the printed subscrit to 2 or 3, it always prints "aa". And since the output is always the same, it gives me no hints about where to look for the mistake. Does anybody know what's wrong with the code? Edit: in the original code I have an array of strings rather than a 2D char array. You can run my attempt with an array of strings by deleting (or putting // to) the CHARARRAY definition. This version doesn't work at all. Either one of the two ways is fine for me.