Reputation: 259
Is there a output in textIO signature to write integers to a file? output only writes vectors, outputsstring writes substrings and output1 writes only characters. My problem with not using vectors is I have to write each integer into a line in the output file.
I am having tough time with SML.
Thank You.
Upvotes: 0
Views: 461
Reputation: 370202
To write an int to a file as a string, just convert it to a string using Int.toString
and then write the string to the file.
To write a number to a file as a byte, use BinIO instead of TextIO. As the name suggests TextIO is for dealing with text - not binary data.
Upvotes: 1