MCPcopy Create free account

hub / github.com/Apress/beginning-rust-2e / functions

Functions846 in github.com/Apress/beginning-rust-2e

Functionmain
It prints: 67*/
Source Code/13-12.rs:3
Functionmain
It prints: (4.5, 'A') (-6.0, 'g')*/
Source Code/10-14.rs:3
Functionmain
It prints nothing. */
Source Code/09-15.rs:3
Functionmain
It prints: 2.3 3.4*/
Source Code/18-16.rs:3
Functionmain
It prints: None, Some(“Jane”)*/
Source Code/19-28.rs:3
Functionmain
()
Source Code/23-08.rs:4
Functionmain
It prints: 57*/
Source Code/16-43.rs:3
Functionmain
It could print: 507.821004ms 1.467µs*/
Source Code/21-05.rs:3
Functionmain
It prints: 3.14, 4, 4.89*/
Source Code/05-22.rs:3
Functionmain
It prints: 12*/
Source Code/15-08.rs:3
Functionmain
It prints: 12*/
Source Code/03-07.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: use of moved value: `v1` */
Source Code/22-16.rs:4
Functionmain
The compiler prints the warning message: denote infinite loops with `loop { ... }` Then, the program prints: 1 4 9 16 25 36 49 64 81 100 121 144 169 1
Source Code/04-13.rs:5
Functionmain
It prints: 2, 5.*/
Source Code/05-02.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: type annotations needed */
Source Code/13-13.rs:4
Functionmain
It prints nothing. */
Source Code/22-26.rs:3
Functionmain
It prints: Dropped 1 Dropped 2 Dropped 3 Dropped 4 Dropped 5 Dropped 6 INNER OUTER */
Source Code/20-04.rs:11
Functionmain
It prints: 3*/
Source Code/08-07.rs:3
Functionmain
It prints: 12*/
Source Code/15-11.rs:3
Functionmain
It prints nothing. */
Source Code/24-04.rs:3
Functionmain
It prints: false true */
Source Code/16-38.rs:3
Functionmain
It prints: These are three lines */
Source Code/02-13.rs:6
Functionmain
It prints: Hello, world!*/
Source Code/14-16.rs:3
Functionmain
It prints: Dropped 1 Dropped 2 Dropped 3 Dropped 4 Dropped 5 Dropped 6 INNER OUTER */
Source Code/20-03.rs:11
Functionmain
It prints: 12345 12345*/
Source Code/22-11.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: the trait `Copy` may not be implemented for this type */
Source Code/22-28.rs:4
Functionmain
It prints: 8 1; 8 2; 8 3*/
Source Code/14-07.rs:3
Functionmain
ILLEGAL. The compiler prints twice the error message: mismatched types */
Source Code/05-14.rs:4
Functionmain
It prints: è さ */
Source Code/06-24.rs:4
Functionmain
It prints: 1 4 16 25 49 64 100 121 169 196 256 289 361 400 */
Source Code/04-12.rs:3
Functionmain
It prints: [132, 86, 38]*/
Source Code/16-55.rs:3
Functionmain
It prints: [22, 33] [11] [11, 22, 33, 44]*/
Source Code/15-21.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: `j1` does not live long enough */
Source Code/23-27.rs:4
Functionmain
It prints nothing. */
Source Code/15-16.rs:3
Functionmain
It prints: [10, -8, 18, 0, -14, -2, 6, 10, 6, 2]*/
Source Code/09-28.rs:3
Functionmain
()
Source Code/18-14.rs:29
Functionmain
It prints: -5, 183.19, x*/
Source Code/08-03.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: missing lifetime specifier */
Source Code/23-15.rs:4
Functionmain
It prints: Hello Hello Hello Hello */
Source Code/14-13.rs:3
Functionmain
It prints: small*/
Source Code/04-05.rs:3
Functionmain
It prints: 5 5 5 5 5*/
Source Code/06-08.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: `n2` does not live long enough */
Source Code/23-13.rs:4
Functionmain
ILLEGAL. The compiler prints the error message: binary operation `==` cannot be applied to type `CardinalPoint` */
Source Code/07-08.rs:4
Functionmain
Source Code/07-17.c:4
Functionmain
ILLEGAL. The compiler prints the error message: borrow of moved value: `v1` */
Source Code/22-07.rs:4
Functionmain
It prints: 0, 1; None, Some(“Jane”)*/
Source Code/19-30.rs:3
Functionmain
It prints: John Doe*/
Source Code/18-07.rs:3
Functionmain
It prints: 2.3 3.4*/
Source Code/18-15.rs:3
Functionmain
It prints: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, */
Source Code/05-16.rs:3
Functionmain
It prints: 4 0*/
Source Code/09-19.rs:3
Functionmain
It prints: INNER Dropped 6 Dropped 5 Dropped 4 OUTER Dropped 3 Dropped 2 Dropped 1 */
Source Code/20-02.rs:11
Functionmain
It prints nothing, but it returns 107 to the launching process. In a Unix-line shell, if you run this program and then type the command: echo $? it pr
Source Code/17-04.rs:11
Functionmain
ILLEGAL. The compiler prints the error message: expected expression, found keyword `fn` */
Source Code/07-06.rs:4
Functionmain
It prints: [7] [7]*/
Source Code/18-03.rs:3
Functionmain
It prints: [11, 22] [33, 44]*/
Source Code/15-22.rs:3
Functionmain
It prints: [true][a]*/
Source Code/06-23.rs:3
Functionmain
It prints nothing. */
Source Code/24-05.rs:3
Functionmain
It prints: 7 7 7 7*/
Source Code/09-34.rs:3
Functionmain
It prints nothing. */
Source Code/09-04.rs:3
Functionmain
It prints: 33*/
Source Code/06-09.rs:3
Functionmain
It could print: 328.600498ms 158.603952ms*/
Source Code/21-04.rs:3
Functionmain
It prints: Hello, world!*/
Source Code/01-02.rs:3
Functionmain
It prints: 5 5 5 5 5*/
Source Code/06-06.rs:3
Functionmain
It could prints: 1599960000 593.578µs 556.144µs 18.647µs 81.504µs*/
Source Code/21-07.rs:3
Functionmain
In a 64-bit system, it will print something different from run to run, but similar to: 140729279188109 140729279188110 140729279188111 In a 32-bit sys
Source Code/12-08.rs:6
Functionmain
It prints: 11*/
Source Code/23-24.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: cannot assign twice to immutable variable `_n` */
Source Code/03-28.rs:4
Functionmain
It prints: 120 abcd true false*/
Source Code/03-29.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: mismatched types with the explanation: expected `i16`, found `u16` */
Source Code/06-13.rs:6
Functionmain
ILLEGAL. The compiler prints the error message: missing lifetime specifier*/
Source Code/23-14.rs:3
Functionmain
It prints: A, B; B, A*/
Source Code/19-12.rs:3
Functionmain
It prints nothing. */
Source Code/08-11.rs:3
Functionmain
It prints: [33, 44, 66] [33, 44, 66] [44] 44*/
Source Code/15-15.rs:3
Functionmain
It prints: -2 is negative. -1 is negative. 0 is zero. 1 is one. 2 is plural. 3 is plural. 4 is plural. */
Source Code/07-23.rs:10
Functionmain
It prints nothing. */
Source Code/03-12.rs:3
Functionmain
It prints: 4 4 */
Source Code/12-02.rs:3
Functionmain
ILLEGAL. The compiler prints the error message: attempt to use a non-constant value in a constant */
Source Code/05-19.rs:4
Functionmain
It prints: [1, 2, 3] [4, 5]*/
Source Code/05-32.rs:3
Functionmain
It prints: This is a sentence This line is a sentence This line contains is a sentence This line contains a sentence This line contains a sentence abo
Source Code/05-25.rs:9
Functionmain
In application code:
Source Code/24-14.rs:14
Functionmain
ILLEGAL. The compiler prints the error message: cannot find function `f` in this scope */
Source Code/18-11.rs:4
Functionmain
It prints: [45, 12, 10, 8, 7, 4, 1, 0]*/
Source Code/13-08.rs:3
Functionmain
Source Code/22-05.cpp:5
Functionmain
In application code:
Source Code/24-16.rs:10
Functionmain
It prints: 0.33333334*/
Source Code/20-15.rs:3
Functionmain
It prints: Hello*/
Source Code/14-05.rs:3
Functionmain
It prints: 3*/
Source Code/22-02.rs:3
Functionmain
It prints: Result: 1*/
Source Code/07-16.rs:3
Functionmain
It prints: S*/
Source Code/07-21.rs:3
Functionmain
It prints: Error: X*/
Source Code/07-15.rs:3
Functionmain
It prints: 1234*/
Source Code/07-24.rs:3
Functionmain
It prints: (a,a,a,a,)*/
Source Code/14-10.rs:3
Functionmain
In an x86_64 system, this could print: [1] [2, 0] [3, 0, 0, 0] [4, 5, 6, 0, 0, 0, 0, 0] [65, 0, 0, 0] [1] [129, 165, 54, 102, 23, 86, 0, 0] */
Source Code/12-07.rs:10
Functionmain
It prints: Undefined, This is the value*/
Source Code/17-07.rs:3
Functionmain
It prints: 18.767569280959872 18.767574*/
Source Code/19-26.rs:3
Functionmain
It prints: None, Some(4.3)*/
Source Code/19-32.rs:3
Functionmain
This program waits for the user to input a line. If you type: Hello and then you press the Enter key, it prints: Ok(6) [Hello ] */
Source Code/17-08.rs:8
Functionmain
ILLEGAL. The compiler prints four times the error message: mismatched types */
Source Code/10-05.rs:4
Functionmain
In a 64-bit system, it prints: 24 8 8, 32 8 8, 24 16 8 Hello, 32 16 8 [Hi] In a 32-bit system, it prints: 12 4 4, 20 4 4, 12 8 4 Hello, 20 8 4 [Hi] */
Source Code/20-21.rs:6
Functionmain
It prints: small*/
Source Code/04-03.rs:3
← previousnext →501–600 of 846, ranked by callers