Question: Read a text file that contains integers, print out each integer to cout and stop when you hit the end of file. Use this program

  • Read a text file that contains integers, print out each integer to "cout" and stop when you hit the end of file.
  • Use this program to read and display the contents of three different text files (textfile1.txt, Read a text file that contains integers, print out each integer textfile2.txtto "cout" and stop when you hit the end of file. Use, textfile3.txtthis program to read and display the contents of three different text) that contain the same numbers but use Unix/Linux, Windows/DOS, and Mac OS end of line characters.
  • Do you encounter any problems? Does it matter what OS you're developing your code on? See if transferring these files from, say, a Windows machine to a Linux machine alters them by checking their ASCII contents using the Linux od -a command (Examples (Links to an external site.) to use the od command).
  • C++ programming language

textfile1.text:

32 71 95 13 65 47 94 81 86 23 2 1 57 65 16 24 11 54 75 3 97 19 100 66 14 79 86 41 31 53 28 14 40 33 31 89 94 45 14 21 78 12 20 87 60 68 75 64 43 83 38 81 70 35 81 44 14 86 54 96 80 95 69 82 71 45 58 53 63 17 72 25 28 67 30 2 29 75 44 69 33 39 69 29 1 53 77 97 34 34 6 37 78 15 52 92 100 20 76 77

textFile 2.txt:

32 71 95 13 65 47 94 81 86 23 2 1 57 65 16 24 11 54 75 3 97 19 100 66 14 79 86 41 31 53 28 14 40 33 31 89 94 45 14 21 78 12 20 87 60 68 75 64 43 83 38 81 70 35 81 44 14 86 54 96 80 95 69 82 71 45 58 53 63 17 72 25 28 67 30 2 29 75 44 69 33 39 69 29 1 53 77 97 34 34 6 37 78 15 52 92 100 20 76 77

textfile3.txt: 32 71 95 13 65 47 94 81 86 23 2 1 57 65 16 24 11 54 75 3 97 19 100 66 14 79 86 41 31 53 28 14 40 33 31 89 94 45 14 21 78 12 20 87 60 68 75 64 43 83 38 81 70 35 81 44 14 86 54 96 80 95 69 82 71 45 58 53 63 17 72 25 28 67 30 2 29 75 44 69 33 39 69 29 1 53 77 97 34 34 6 37 78 15 52 92 100 20 76 77

Transcribed image text

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!