I was wondering if there was anyway to overload the ostream with a counting variable for instance
ostream& operator << (ostream& out, TYPE t,int i);
I need the int to help output part of an array and it would be a lot easier if I could just send an int through the overload
You may use
and write function
ostream& operator << (ostream& out, TypeOut t);