Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

using namespace std in an implementation file is not a big deal, though I tend to think of that as sign of laziness, since typing std:: is not going to cost you that much. We are not talking about a_very_long_namespace_name. But this is an open-ended discussion discussion anyway.

using namespace std in an implementation file is not a big deal, though I tend to think of that as sign of laziness, since typing std:: is not going to cost you that much. We are not talking about a_very_long_namespace_name. But this is an open-ended discussion anyway.

using namespace std in an implementation file is not a big deal, though I tend to think of that as sign of laziness, since typing std:: is not going to cost you that much. We are not talking about a_very_long_namespace_name. But this is an open-ended discussion anyway.

added 16 characters in body
Source Link
glampert
  • 17.3k
  • 4
  • 31
  • 89

YouYour code is filled with magic numbers. Taking the constructor of PEND, for instance, there are five or six different constants used, none of these are explained with comments. Try to turn them into named constants, or at least comment why you've chosen the given values.

The spacing gives more emphasis and visibility to the operators.

You code is filled with magic numbers. Taking the constructor of PEND, for instance, there are five or six different constants used, none of these are explained with comments. Try to turn them into named constants, or at least comment why you've chosen the given values.

The spacing gives more emphasis to the operators.

Your code is filled with magic numbers. Taking the constructor of PEND, for instance, there are five or six different constants used, none of these are explained with comments. Try to turn them into named constants, or at least comment why you've chosen the given values.

The spacing gives more emphasis and visibility to the operators.

Made small improvements in the text. Added extra links.
Source Link
glampert
  • 17.3k
  • 4
  • 31
  • 89

Rid is a bad abbreviation for the passwordId. I'm not exactly sure what int raw is representing...

###Too maymany hardcoded constants:

i is being used to index the Password array, which is only 70 chars in size! Aren't you getting a memory access violation when running this code? Instead os using raw arrays, consider std::array or std::vector , using the size() method to query the array length.

 for(int i = 0; i < key; i++)

Rid is a bad abbreviation for the passwordId. I'm not exactly sure what raw is...

###Too may hardcoded constants:

i is being used to index the Password array, which is only 70 chars in size! Aren't you getting a memory access violation when running this code?

 for(int i = 0; i < key; i++)

Rid is a bad abbreviation for the passwordId. I'm not exactly sure what int raw is representing...

###Too many hardcoded constants:

i is being used to index the Password array, which is only 70 chars in size! Aren't you getting a memory access violation when running this code? Instead os using raw arrays, consider std::array or std::vector , using the size() method to query the array length.

 for(int i = 0; i < key; i++)
Fixed a typo.
Source Link
glampert
  • 17.3k
  • 4
  • 31
  • 89
Loading
Source Link
glampert
  • 17.3k
  • 4
  • 31
  • 89
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /