Re: checking for null
Strictly speaking, in C++, a null pointer is 0, not 0l, 0L, null, or NULL. It's just something to be aware of, since 0 is usually the convention, and also some people feel pretty strongly about it. :/
Bojan
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
Bookmarks