Hi, Im new to c++ and Im struggling with something.
I have a load of classes that all connect to each other. I globally overloaded the << operator for each class. So in my main I do the following:
FixedSizeMatrix y(5,5); cout<<y; cout<<y;
The first cout works fine but the second ne gives me a segementation fault. Now I know a segmentation fault is a problem with memory and the cnstructors and destructors. I put a cout statement in my destructor and to my surprise I saw that directly after the first cout<<y; statement is executed the destructor is called.
Im completely lost as to why this is. Any suggestions?