In C Create a main body name the file addcpp The main reads
In C++, Create a main body, name the file add.cpp. The main reads from the file data1-1.txt and must do the following:
Test for success of opening the file in your program. (opening the file)
Read in two numbers into a class object (like class bigint) and write both out on separate lines.
Add these two inputs together and output the result.
Then read in two more big numbers, adding them and writing the result until end of file.
All output must be labeled and neat.
Solution
#include<stdio.h>
 #include <fstream>
 #include <string>
 #include <iostream>
using namespace std;
 int main () {
 string sentence;
   
 ifstream myfile (\"D:\\\\add.txt\");
 if (myfile.is_open())
 {
 while ( getline (myfile,sentence) )
 {
    cout<<\"the sentence with delimeters\"<<endl;
 cout << sentence << \'\ \';
 int i = std::stoi(sentence);
 std::cout << i << \" \" << sentence << std::endl;
}
   
 }
 myfile.close();
 }
else cout << \"Unable to open file\";
return 0;
 }

