N
Nick Valeontis
I am confused.
Why does this not work?
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
template<class T> void PrintArray(T data[], int start, int stop, int
col_length = 3) {
for (int i = start; i <= stop; i++)
std::cout << std::setw(col_length) << data << " ";
std::cout << std::endl;
}
template<class T> void PrintArray(T data[], int col_length = 3) {
//sizeof(data)/sizeof(typeof(data[0]) = 0 !:O
PrintArray(data, 0, sizeof(data)/sizeof(typeof(data[0])), col_length);
}
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
---- ----
If i run the same expression in my main, i get the correct result.. ????
Why does this not work?
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
template<class T> void PrintArray(T data[], int start, int stop, int
col_length = 3) {
for (int i = start; i <= stop; i++)
std::cout << std::setw(col_length) << data << " ";
std::cout << std::endl;
}
template<class T> void PrintArray(T data[], int col_length = 3) {
//sizeof(data)/sizeof(typeof(data[0]) = 0 !:O
PrintArray(data, 0, sizeof(data)/sizeof(typeof(data[0])), col_length);
}
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
---- ----
If i run the same expression in my main, i get the correct result.. ????