   Output not working properly
  In my program, I have two constructors for my game object, one plain, the other which takes a string parameter.I also have a debug object which takes an output string, then either prints it to the console, a log file, or wherever else you point it. Right now it points to the console.My problem is that if I don't pass a parameter to the game object (so I use the default constructor) nothing gets printed on the screen, but if I pass a parameter (use the overloaded constructor) it works just fine.cCore game() the game runs without printing anythingcCore game("foo") the game prints outfooInitializing Coreclass cCore{public:    cCore(); //initialize without string    cCore(string PARAM);    //initialize, with string    ~cCore();//destructor    void init();    debug DEBUG;};cCore::cCore(){    param = "";    init();}cCore::cCore(string PARAM){    param = PARAM;    DEBUG(param, 2);    init();}void cCore::init(){    try //protect against errors during startup    {   DEBUG("Initializing Core", 2);   // do other stuff    }    //deal with any errors during initialization    catch (string ERR)    {   DEBUG("Error: Initialization->" + ERR, 0);  //output error message    }}And the debug objectusing namespace std;class debug{public:    void operator() (string MSG, int TYPE);};void debug::operator() (string MSG, int TYPE){    cout<<MSG<<endl;}
  Your source code is inconsistent, which leads me to believe that you may be inadvertently leaving out an important section of the code that explains the problem. In particular, "param" is never declared anywhere.   ;Quote:Original post by methinkscCore game() the game runs without printing anythingcCore game("foo") the game prints outfooInitializing Coretry changing cCore game() to cCore gameFor example#include <iostream>class foo{public:    foo() {std::cout << "constructor called" << std::endl;}};int main(){    // calls the constructor we made for foo    foo bar;   // doesn't call the constructor we made for foo    foo baz();};  Will F - Thanks, that did it!k2 - Sorry, my bad. I only copied what I figured were the relevant sections, to keep it small, I guess I missed some stuff.   