Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

答案输出格式问题——变量绑定与解构solutions/variables.md 第4题解法2 #538

Open
Autumn716 opened this issue Nov 7, 2024 · 0 comments

Comments

@Autumn716
Copy link

修改后代码如下:

fn main() {
    let x = define_x();
    println!("{}, world", x);
}

fn define_x() -> &'static str {
    let x = "hello";
    x
}

修改前输出结果为:"hello", world
修改后输出结果为:hello, world

@Autumn716 Autumn716 reopened this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant