0

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.

700resu
  • 259
  • 6
  • 16

1 Answers1

1

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.

sepp2k
  • 363,768
  • 54
  • 674
  • 675