Creating “transposed” files with random characters

前端 未结 1 748
小蘑菇
小蘑菇 2021-01-28 09:21

I want to create a program that creates \".txt\" files with random characters, but with the possibility of creating transposed \"files\". Next, I add an example of two \".txt\"

相关标签:
1条回答
  • 2021-01-28 09:49
    • to create a transposed version of file1.txt, you'll have to keep its content in memory and visit that content in a transposed way.

    • when you write

      if(myfileS.is_open())
      srand(time(0));
      

      you just conditionalize the srand of the fact that the file is open or not. Not what follows. I'd put braces around everything.

    • the best way to test the status of an IOStream is just to use it as a condition

      if (myfileS)
      
    0 讨论(0)
提交回复
热议问题