Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Error in source code' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Error in source code
Authored by: wallybear on Apr 17, '09 04:32:53AM
There is an error in the source code.
If you call the program with no arguments, it should display the current resolution settings, but it cannot because the printf parameters are wrong (they expect two integer values, but the variables are floats).
To obtain the expected output you have to substitute the following line:

printf("%d %dn", screenSize.width, screenSize.height);
with this one:

printf("%.0f %.0fn", screenSize.width, screenSize.height);



[ Reply to This | # ]
Error in source code (correction)
Authored by: wallybear on Apr 17, '09 04:48:41AM
The site killed the backslashes; here is the correct line:

printf("%d %d\n", screenSize.width, screenSize.height);

with this one:

printf("%.0f %.0f\n", screenSize.width, screenSize.height);



[ Reply to This | # ]