-
Notifications
You must be signed in to change notification settings - Fork 0
Printing
Utku Melemetci edited this page May 17, 2024
·
1 revision
The standard library has functions for printing integers, strings, booleans, and newlines. There is additionally a print command that works only for integers and may be useful for debugging. Note that while print_string outputs a newline, print_int and print_bool do not.
func main() {
std::print_string("Hello, world")
std::print_int(1)
std::print_endline()
std::print_bool(true)
std::print_endline()
print 10
}The print 10 at the end will output a new line. In general, it is recommended that you use the standard library functions where possible.