Crate cs50_rust

Crate cs50_rust 

Source
Expand description

Simple input functions for Rust, inspired by CS50’s C library.

This library provides straightforward functions for getting user input, similar to those used in Harvard’s CS50 course. Each function will continue prompting until it receives valid input.

Note: This is an unofficial project and is not affiliated with Harvard University or the CS50 course.

Functions§

get_bool
Gets a boolean value from the user.
get_char
Gets a single character from the user.
get_double
Gets a 64-bit float. Alias for CS50 compatibility.
get_f32
Gets a 32-bit floating point number.
get_f64
Gets a 64-bit floating point number
get_float
Gets a 32-bit float. Alias for CS50 compatibility.
get_i8
Gets a signed 8-bit integer (-128 to 127)
get_i16
Gets a signed 16-bit integer (-32,768 to 32,767)
get_i32
Gets a signed 32-bit integer (-2,147,483,648 to 2,147,483,647)
get_i64
Gets a signed 64-bit integer
get_i128
Gets a signed 128-bit integer
get_int
Gets a signed 32-bit integer. Alias for CS50 compatibility.
get_isize
Gets a pointer-sized signed integer
get_long
Gets a signed 64-bit integer. Alias for CS50 compatibility.
get_string
Gets a string from the user.
get_u8
Gets an unsigned 8-bit integer (0 to 255)
get_u16
Gets an unsigned 16-bit integer (0 to 65,535)
get_u32
Gets an unsigned 32-bit integer (0 to 4,294,967,295)
get_u64
Gets an unsigned 64-bit integer
get_u128
Gets an unsigned 128-bit integer
get_usize
Gets a pointer-sized unsigned integer