include <iostream>
usingnamespace std;
int main()
{
int x = 1;
char line1[]="Line #1";
char line2[]="Line #2";
char line3[]="Line #3";
char line4[]="Line #4";
while (x < 5)
{
cout << line[x][] << endl;
}
/*
Output should be:
Line #1
Line #2
Line #3
Line #4
*/
}
I'm getting a lot of errors, but I do know that it's something similar to that
Notice that I used a forloop to iterate through the array, this is because the size of an array is ALWAYS fixed, so if you know the number of iterations then it is better to use a forloop.