[Qt-interest] Interaction between QApplication and swscanf
thomas porez
thomasporez at gmail.com
Thu Sep 10 11:19:48 CEST 2009
I have strange behaviour with the swscanf function in my QT programs : This
function always returns 0 when a QApplication is declared ...
Thanks for your help !
Here is the minimal code with the strange behaviour :
CODE
#include <QApplication>
float getVal()
{
float val;
wchar_t wStr[] = L"0.98";
swscanf( wStr, L"%f", &val );
return val;
}
int main(int argc, char ** argv)
{
printf( "Without QApp : %f\n", getVal() );
QApplication app( argc, argv );
printf( "With QApp : %f\n", getVal() );
}
OUTPUT
Without QApp : 0.980000
With QApp : 0,000000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090910/f2c98210/attachment.html
More information about the Qt-interest-old
mailing list