I am very new to c++. I am getting system crash (not compilation error) in doing following:
I am declaring global pointer of class.
BGiftConfigFile *bgiftConfig;
class BGiftConfigFile : public EftBarclaysGiftConfig { }
in this class I am reading tags from XML file. it is crashing system when this pointer is used to retrieve value. I am doing coding for verifone terminal.
int referenceSetting = bgiftConfig->getreferencesetting(); //system error
getreferencesetting() is member function of class EftBarclaysGiftConfig
I am confused about behavior of pointer in this case. I know I am doing something wrong but couldn't rectify it.
When I declare one object of class locally it retrieves the value properly.
BGiftConfigFile bgiftConfig1;
int referenceSetting = bgiftConfig1.getreferencesetting(); //working
But if I declare this object global it also crashes the system.
I need to fetch values at different location in my code so I forced to use something global.
How to rectify this problem?