The source code to create an alias of built-in data type is given below. The given program is compiled and executed successfully.
// Rust program to create an alias
// of built-in data type
fn main() {
type int=i32;
let mut num:int=1024;
println!("Number: {}",num);
}
Output:
Number: 1024
Explanation:
Here, we created the alias of the i32 data type using the type keyword. Then we created a variable using created alias name and printed the value of the variable.
Program/Source Code:
The source code to create an alias of built-in data type is given below. The given program is compiled and executed successfully.
Output:
Explanation:
Here, we created the alias of the i32 data type using the type keyword. Then we created a variable using created alias name and printed the value of the variable.
need an explanation for this answer? contact us directly to get an explanation for this answer