A

Admin • 833.24K Points
Coach

Q. Which of the following is a valid way to define a struct in Rust?

  • (A) struct MyStruct { name: String }
  • (B) class MyStruct { name: String }
  • (C) type MyStruct = { name: String }
  • (D) object MyStruct { name: String }
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category Rust
  • Hashtags:

Explanation by: Admin

Rust uses the 'struct' keyword to define custom data types.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.