1.f is a valid float.
It is not the same as 1.0, because 1.f is a float and 1.0 is a double. 1.0 is a double because double is the C/C++ default floating-point type. 1.d is a double.
For a lot more detail, see: http://www.cplusplus.com/doc/tutorial/constants/
Friday, November 21, 2014
Tuesday, August 2, 2011
C++ Mentoring
I provide C++ Mentoring. If you are interested in being mentored, please contact me via glen.ritschel@gmail.com
Please see my video on Argument Dependent Lookup (ADL): http://www.youtube.com/watch?v=1xt2t_S6UR0
I also have an short online C++ quiz at: http://cpptrivia.appspot.com
Please see my video on Argument Dependent Lookup (ADL): http://www.youtube.com/watch?v=1xt2t_S6UR0
I also have an short online C++ quiz at: http://cpptrivia.appspot.com
Thursday, December 9, 2010
The Singleton Design Pattern
One of the most famous design patterns is Singleton: http://en.wikipedia.org/wiki/Singleton_pattern
Wednesday, December 8, 2010
Sample Code
Sample code should be written in the style of production code, because many times sample code becomes production code.
Reference: “C++ Design” by Steve Weinrich, unpublished manuscript.
Reference: “C++ Design” by Steve Weinrich, unpublished manuscript.
Tuesday, December 7, 2010
Header Files
When you publish a header file, anything that you #include into that header file is a part of your interface. “C++ Design” by Steve Weinrich, unpublished manuscript.
Monday, December 6, 2010
Indentation
Indent case statements one space. Indent other statements three spaces.“C++ Design” by Steve Weinrich, unpublished manuscript.
Indentation
Indent public/private/protected access specifiers one space. Indent member variables 3 spaces. “C++ Design” by Steve Weinrich, unpublished manuscript.
Subscribe to:
Posts (Atom)
