variable declaration style
I've always been told this was just a matter of style/taste, but I was wondering if that is actually the case:
example 1 - better for brevity:
Code:
LPDIRECTINPUTDEVICE7 diKB=NULL, diMS=NULL;
int a=0, b=0, c=0;
example 2 - better for clarity:
Code:
LPDIRECTINPUTDEVICE7 diKB=NULL;
LPDIRECTINPUTDEVICE7 diMS=NULL;
int a=0;
int b=0;
int c=0;
I've tried both on large projects and haven't noticed anything different as far as compile time, program speed, etc.. Is either considered a standard or is it really just a matter of taste?
I will go with what Prelude worte
Quote:
Originally posted by Prelude
Code:
int a = 0,// comment1
b = 0, // comment 2
c = 0;
and If you add some comments that will be great ;)