Question:

In the code below, what data type will be assigned to result?

let result = UInt8.addWithOverflow(UInt8.max, 1)

 

Correct answer: Tuple.

Explanation: The UInt8.addWithOverflow() method returns a tuple (UInt8, Bool) where the first value stores the result of the add operation, and the second value stores whether an overflow happened.


Keywords:

© 2017 QuizBucket.org