How to output array of doubles to hard drive?

前端 未结 6 525
野的像风
野的像风 2020-12-09 06:42

I would like to know how to output an array of doubles to the hard drive.

edit:

for further clarification. I would like to output it to a file on the hard

6条回答
  •  情书的邮戳
    2020-12-09 06:57

    #include 
    #include 
    
    using namespace std;
    
    int main () {
      double [] theArray=...;
      int arrayLength=...;
      ofstream myfile;
      myfile.open ("example.txt");
      for(int i=0; i

    adapted from http://www.cplusplus.com/doc/tutorial/files/

    Just set theArray and arrayLength to whatever your code requires.

提交回复
热议问题