C++ HELP, I can get the program running, but I can figure out how to add things together from a inFi
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{ double sum;
int count ;
int val;
ifstream infile;
char a,b,c;
infile.open ("p3_data.txt");
if (infile.is_open())
{
while (infile.good())
cout << (char) infile.get();
infile.close();
}
else
{
cout << "Error opening file\n";
}
cout << "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...
cout << "\nPlease enter either A, B, or C to be calculated!\n";
cin >> a>>b>>c;
cout << "\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-...
cout << "The bills add up to "<<endl;
system("pause");
return 1;
}
/*My program is only adding up 3 different things A B C. I can do everything else I just cant figure this one out. */
Thanks for the help
C++ HELP, I can get the program running, but I can figure out how to add things together from a inFile.?c++ class
I'm not exactly sure about what you are trying to do, but if you are trying to add up three numbers, each separated by spaces, one per line, then this might get you started:
#include <iostream>
#include <fstream>
More Related Questions and Answers ...
The information post by website user , we not guarantee correctness.
Dental Treatment Skin Whitening Skin Problems Skin Rashes Shoes
