mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
davhojt
e5b2736b09
|
3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago |
README.md
doubtful
Instructions
Create a function named doubtful
which appends a question mark to every string passed to it. It must not return a value.
pub fn doubtful(s: /*give the correct type*/ ) {
}
You'll need to complete the function signature, so that it works properly with the usage example. You'll also need to complete the usage if you plan to use it.
Usage
Here is a program to test your function
fn main() {
let mut s = String::from("Hello");
println!("Before changing the string: {}", s);
doubtful(/*add your code here*/);
println!("After changing the string: {}", s);
}
And its output
$ cargo run
Before changing the string: Hello
After changing the string: Hello?
$