I have a question about trying to debug my C++ program. I'm programming in Eclipse and can't get the debugger to work, probably because of spaces in my project name. That's fine for now.
I'm trying to just use cout to debug by printing out things. I have a file called test.cc which contains my main method and a line in it that says list2 = list1; I have a file dlist.h which defines the template, and a file dlist.cc which implements it. It works fine until the line list2=list1 in test.cc. I am using operator overloading like so:
dlist.c
My thought is, because I put a cout here, I should get COPY printed when I do list2=list1 even if I implemented copying incorrectly, but I don't ever see this. The program compiles and isn't crashing or anything. I #include <iostream> and using namespace std; in my dlist.ccCode:template <typename T> Dlist<T>& Dlist<T>::operator=(const Dlist &l) { cout << "COPY" <<endl; if(this!=&l) copyAll(l); return *this; }