Browse Source

docs(print_and_consume): description of exam exercise

pull/1603/head
eslopfer 2 years ago
parent
commit
982c87d34d
  1. 39
      subjects/print_and_consume/README.md

39
subjects/print_and_consume/README.md

@ -0,0 +1,39 @@
## print_and_consume
### Instructions
Create a function `print_and_consume` which takes a `String`, print the string with a new line at the end and consume it (the string can't be used after the function is called).
Create a function `only_print` that takes a `String` and print it with a new line without consuming it.
### Expected functions
```rust
pub fn print_and_consume(argument) {
}
pub fn only_print(argument) {
}
```
### Usage
Here is a possible program to test your function :
```rust
use print_and_consume::*;
fn main() {
}
```
And its output:
```console
$ cargo run
$
```
Loading…
Cancel
Save