I have the code to print out time in the following format: 00 01 02 03 04 05 06 07 08 09 10 11... only that the first number (0) needs to be above the second number (0).. Below is what I have
#include <iostream> using namespace std; void printArray (int arg[], int length) { for (int n=0; n<length; ++n) cout << arg[n] << ' '; cout << '\n'; } int main() { int ftime[99] = {0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2}; int ttime[99] = {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0}; cout << "Time: ";printArray(ftime,21); cout << " ";printArray(ttime, 21); return 0; } Now the following prints out:
Time: 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 Which is exactly what I want, but I need to do this all the way to 99 and was wondering if there is an easier way to initialize both the ftime and ttime arrays other than the way I did it. Any input would be greatly appreciated!