I just got done writing an array program, and now I got stuck on the next one I had to write. The code is supposed to display. My code displays the proper characters on each line, but it does decrease. I do not know why each new programming problem seems impossible.
<<<<<<<<
>>>>>>>>
<<<<<<
>>>>>>
<<<<
>>>>
<<
>>
The code seems to write a single character infinite loop
I have never attempted a 2d array before. I wrote this after a little internet research. char print['<']['>'];
But I do not understand how to call the different elements of the array, or even if that is the right code.
You can think that 2D or more as a diagram,
It'll looks like
char x[][]
The first [] fill wth how many sentence that you'll create
And the second one is how many character for each sentence
Okay after reading what you said here is my idea. I will create two arrays, one for each char. Then I will use each array in a separate loop to print their characters. I was thinking of using a modulus if else to determine which array is in play on which line. Does any of that sound correct?
you wrote char X[2][9], what is the 9 for? Your code only displays 8 characters. Also is your inner loops supposed to use the variable j? If not how is j used in the code?