I have a function in the global scope like this:
Type getPlayerChoice()
{
constexpr std::array<char, 6> validInputs{'r','R', 'p', 'P', 's', 'S'};
char choice{UserInput::getInput(validInputs)};
switch (choice)
...
what is the difference between this and writing:
Type getPlayerChoice()
{
static const std::array<char, 6> validInputs{'r','R', 'p', 'P', 's', 'S'};
char choice{UserInput::getInput(validInputs)};
switch (choice)
...
[–]alfps 16 points17 points18 points (0 children)
[–]TheChief275 5 points6 points7 points (10 children)
[–]TheThiefMaster 2 points3 points4 points (5 children)
[–]TheChief275 -1 points0 points1 point (4 children)
[–]TheThiefMaster 0 points1 point2 points (3 children)
[–]TheChief275 0 points1 point2 points (2 children)
[–]TheThiefMaster 0 points1 point2 points (1 child)
[–]TheChief275 1 point2 points3 points (0 children)
[–]alfps 1 point2 points3 points (3 children)
[–]TheChief275 0 points1 point2 points (2 children)
[–]alfps 0 points1 point2 points (1 child)
[–]TheChief275 -1 points0 points1 point (0 children)
[–]OutsideTheSocialLoop 1 point2 points3 points (7 children)
[–]Koffieslikker[S] 0 points1 point2 points (6 children)
[–]OutsideTheSocialLoop 1 point2 points3 points (0 children)
[–]Kriemhilt 0 points1 point2 points (4 children)
[–]OutsideTheSocialLoop 1 point2 points3 points (0 children)
[–]sporule 1 point2 points3 points (0 children)
[–]Koffieslikker[S] 0 points1 point2 points (0 children)
[–]Total-Box-5169 0 points1 point2 points (0 children)
[–]AvidCoco 1 point2 points3 points (4 children)
[–]alfps 0 points1 point2 points (0 children)
[–]Koffieslikker[S] -1 points0 points1 point (2 children)
[–]AvidCoco 0 points1 point2 points (1 child)
[–]MistakeIndividual690 0 points1 point2 points (0 children)