Skip to content

esercizio verify#444

Open
valeriacutrona wants to merge 3 commits intoUNICT-Quality-Development:mainfrom
valeriacutrona:ex-verify
Open

esercizio verify#444
valeriacutrona wants to merge 3 commits intoUNICT-Quality-Development:mainfrom
valeriacutrona:ex-verify

Conversation

@valeriacutrona
Copy link
Copy Markdown

esercizio verify svolto

Copy link
Copy Markdown
Collaborator

@TendTo TendTo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il valore 10, che corrisponde all lunghezza dell'array, qui è hardcoded. Cosa succede che si rende necessario aggiungere o rimuovere qualche elemento? Sarebbe meglio usare un valore costante, una #define o calcolarlo con sizeof (quest'ultimo vale solo se si tratta di un array con dimensioni note a compile time, come in questo caso).

Comment thread exercises/verify.cpp
Comment on lines +21 to +26
for (int i = 0; i < 10; ++i) {
if (N[i] == num) {
found = true;
break;
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questa potrebbe essere una funzioncina a se stante

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants