cout supports a lot of formatting options, and you can add more. It is a very flexible design, much more flexible than printf. But the design is very verbose and convoluted compared to printf.
You can use printf defined under stdio. Use a corresponding qualifier.
I agree. For most of the formatting jobs that printf can do, it is shorter and probably faster that cout. Which makes more sense here when printing fixed format with no precision?
using namespace std;
long double value = 100000000.0;
// chained modifiers on cout
cout << fixed << setprecision(0) << value << '\n';
// printf with a format string
The cout line is a little over twice as long, and it is not as obvious what the output will look like by skimming the code. I think formatting macros embedded in an output string are easier to figure out, but not having to type all of that extra junk is a big win.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...