Question: Hi, I am work on a c++ program and I am outputting integers to an output file(ofstream) in order to store the numbers. Then later

Hi, I am work on a c++ program and I am outputting integers to an output file(ofstream) in order to store the numbers. Then later I need to output the contents of that file but I cannot figure out how too. I know how to read and print contents of fstream or ifstream but not ofstream. Here is a copy of part of my program. NumFile is declared earlier as ofstream and e is an integer and d is declared as a character. Thanks!

Hi, I am work on a c++ program and I am outputting

// While loop to read in character input(d), ends when newline character is reached while(cin.get(d) && d !- 'n') // Multiply ASCII of each character in character d and multiply is by amodN e int(d) * a % N; Output encrytednumber,e // Break out of loop once length of characters is greater than 10,000 if(count 10000) break; NumFile

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!