Rust (Programming Language)
Q1. Which type cast preserves the mathematical value in all cases?
Q2. What do the vertical bars represent here?
str:: thread:: spawn ( || {
println ! ( "LinkedIn" ) ;
} ) ;
Q3. Which choice is not a scalar data type?
Q4. _ cannot be destructured.
Q5. Which cargo
command checks a program for error without creating a binary executable?
Q6. The term box and related phrases such as boxing a value are often used when relating to memory layout. What does box refer to?
Q7. What is an alternative way of writing slice
that produces the same result?
...
let s = String :: form ( "hello" ) ;
let slice = & s[ 0 ..2 ] ;
Q8. Using the ?
operator at the end of an expression is equivalent to _ .
Q9. Which is valid syntax for defining an array of i32 values?
Q10. What syntax is required to take a mutable reference to T, when used within a function argument?
fn increment ( i : T ) {
// body elided
}
Q11. The smart pointers Rc and Arc provide reference counting. What is the API for incrementing a reference count?
Q12. What happens when an error occurs that is being handled by the question mark (?) operator?