Serialization and Deserialization

Compared to strings, reading/writing numbers to and from a file is tedious. This is because the write() function writes a string to a file and the read() function returns a string read from a file. So we need to do conversions while reading/writing, as shown in the following program:

Get hands-on with 1200+ tech skills courses.