© Carlo Milanesi 2018
Carlo MilanesiBeginning Rusthttps://doi.org/10.1007/978-1-4842-3468-6_17

17. Input/Output and Error Handling

Carlo Milanesi1 
Bergamo, Italy
In this chapter, you will learn:
  • How to get the arguments from the command line used to launch the program

  • How to return a status code to the operating system when exiting the program

  • How to get and set the process environment variables

  • Techniques and best practices to handle runtime errors

  • How to read from the console keyboard and how to write to the console screen

  • How primitive types are converted to string

  • How to read or write a binary file

  • How to read a text file a line at a time

Command-Line Arguments

The most basic form of input of a program is through the command line.

let command_line: ...

Get Beginning Rust: From Novice to Professional now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.