Hi all. Somthing strange is going on... I want to use "-debug" command line parameter to make my app show some debug info. Here is my code (not entire but needed part)...
#include <iostream.h>
bool debug_mode=0;
int main(int argc, char **argv)
{
if(argv>1) cout << argv[0] << endl << argv[1] << endl;
if( (argc>1) && (argv[1]=="-debug") ) debug_mode=1;
// Some code that checks my database integrity, and does not use
// debug_mode variable in any way
if(debug_mode)
{
cout << "Some debug information" << endl;
}
// here is additional code
return 0;
}
The problem is that when I start my app with "-debug" (exactly "./dbreader -debug") parameter I can see that my argv[0] is "./dbreader" and argv[1] is exactly "-debug" but my IF STATMENT didn't set debug_mode to "1", and so no additional info is shown...