I really like WxWidgets, and I started with C ++ programming. My sample program converts Celsius to Fahrenheit from a text form. Here is my main code:
wxString szCelsius = TextCtrl1->GetValue();
long lCelsius;
szCelsius.ToLong(&lCelsius, 10);
long lFahrenheit = ((9.f/5.f) * lCelsius + 32);
wxString debuginfo;
debuginfo << _T("deg C: ") << lCelsius << _T("\n");
debuginfo << _T("deg F: ") << lFahrenheit << _T("\n");
std::cout << lCelsius;
assert(lCelsius == 100);
Now with debug information, the lCelcius 100 is as expected, but it returns Fahrenheit as 211 instead of 212! It is strange that this formula works fine in pure C, and when I replace lCelsiuswith 100, it works fine, although my debugging information clearly says that it is 100.
Do you see any obvious problem, or I just can't do such a simple thing? I'm not sure what Wx does to make it smaller than necessary.
EDIT: assert.h lCelsius == 100 , std:: cout lCelsius 100. - Wx, , "100"..