P
Penna Elabi
In the below Linux C++ program, why do I need endl commands to see the
numbers in array exampleArray? I mean that if I remove the endl
commands, the program doesn't print anything -- why not?
---------------------------------------------------
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
string exampleArray[2][2] = {{"0","1"},{"1","0"}};
cout << exampleArray[0][0] << endl;
cout << exampleArray[1][0] << endl;
cout << exampleArray[0][1] << endl;
cout << exampleArray[1][1] << endl;
return EXIT_SUCCESS;
}
---------------------------------------------------
numbers in array exampleArray? I mean that if I remove the endl
commands, the program doesn't print anything -- why not?
---------------------------------------------------
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
string exampleArray[2][2] = {{"0","1"},{"1","0"}};
cout << exampleArray[0][0] << endl;
cout << exampleArray[1][0] << endl;
cout << exampleArray[0][1] << endl;
cout << exampleArray[1][1] << endl;
return EXIT_SUCCESS;
}
---------------------------------------------------