A

Admin • 802.91K Points
Coach

Q. Which macro is used to create a vector with repeated elements?

  • (A) vec![x; n]
  • (B) repeat_vec!(x, n)
  • (C) make_vec(x, n)
  • (D) vec_repeat!(x, n)
  • Correct Answer - Option(A)
  • Views: 7
  • Filed under category Rust
  • Hashtags:

Explanation by: Admin
`vec![x; n]` creates a vector with `n` copies of `x`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.