Is it a good practice to use these definitions for fundamental types?
int num1(), num2(0);
char ch1(), ch2(' ');
They can be easily mistaken for function definitions.
int nam1();
char ch1();
Because C++ lets you place variable declarations at any point in the program...I think there's little excuse for uninitialized variables.
There is a bit of controversy regarding the difference in C++11 between Type var (param);
and Type var {param};
with the latter being prescribed via what is called Uniform Initialization. I've tried to only use uniform initialization and gotten some weird edge cases out of it. I'm not sure it's all it's cracked up to be, and have been backing off and generally seeking code clarity.
So I would say char ch1(' ');
, by virtue of being ugly, is better said as char ch = ' ';
It really is a system of tradeoffs.