i was not able to print an a value (float) to a file with the OCaml lenguage. How can i do? If you know how, can you show me a little example?
Thank you advance and have a good day!
Printf.fprintf
allows direction to an out_channel
, in your case a file. Reasonably, you'd open the file for writing first, and pass around that channel.
Printf.fprintf (open_out "file.txt") "Float Value of %f" 1.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With