Beginner Rust
Q11 / 100

What is an enum in Rust?

Correct! Well done.

Incorrect.

The correct answer is B) A type that can be one of several variants, each optionally holding data

B

Correct Answer

A type that can be one of several variants, each optionally holding data

Explanation

enum Message { Quit, Move { x: i32, y: i32 }, Write(String) } — Rust enums are algebraic data types, far more powerful than C enums.

Progress
11/100