@Jackson Marie
I disagree a bit, declaring variables all together on one line does not make the code easier to read IMO.
If you put them each on their own line, you have the opportunity to initialise them (not doing this is often a major source of errors), and write a comment to say what the variable means (important if it is abbreviated), or provide info about valid ranges etc.
With variable names, I like to do this:
1 2 3
|
const float TaxRate = 0.07;
unsigned NumDays;
unsigned NumBooks;
|
As you can see Words can be abbreviated a bit, use capitals for the first letter. Don't use underscores - it make the name too long.
As for
type hungarian notation, there are all kinds of personal preferences which probably don't match up between different people. For example I might use i for int, and p for pointer. I have gone away from that for basic types these days - my IDE tells me all sorts of info about variables. I still use p for pointer and C for class, and m_ for member variables.
With integer types, I use the stdint header which has types described by their sign and the number of bits used like uint8_t, int32_t, uint64_t instead of unsigned char, int and unsigned long (possibly unsigned long long)
HTH