Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
seems like I shouldn't have taken the advice for granted. primality check seems to work pretty descent.
Because he is passing
number
as a reference.This would mean if he would change
number
in the body ofopposite
, the value would be also manipulated outside the function.This is clearly not wanted.
const
declares that number will be treated as constant in this function and has two purposes:number
as a reference, it will not be changedopposite
can not accidently changenumber
as this would result into a compilation error.