S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What is the main goal of lifetimes in Rust?

  • (A) Runtime memory allocation
  • (B) Garbage collection
  • (C) Prevent dangling references
  • (D) Faster performance
  • Correct Answer - Option(C)
  • Views: 25
  • Filed under category Rust
  • Hashtags:

Explanation by: Shyam Dubey

Lifetimes ensure references are valid and prevent dangling pointers.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.