Working with Input
So far, all the strings we’ve used in our programs have come from CString literals in our code such as c"hello, world". But in general, most strings your programs will handle don’t come from the code itself; instead, they come from the outside world, either from a file, network, database, or somewhere else. These scenarios all have different nuances, but they have a lot in common, too. But the simplest way to get data into a command-line program is to read data in from the console.
How do we represent the stream of input from the console in a Scala Native program? In C, and in Scala Native, the standard input and output streams of a command-line program are represented as objects of the same FILE type as an ordinary file ...
Get Modern Systems Programming with Scala Native now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.