hotglass
Aug 9, 2008, 03:30 PM
The inFile was made in Word for Mac and it contains the number 5.50. When I run this, it is successful, yet there is just a blank output, where I want it to display the number 5.50.
#include <iostream>
#include <fstream>
using namespace std;
int main (int argc, char * const argv[])
{
double dec;
ifstream inFile;
inFile.open ("sample.txt");
inFile >> fixed >> showpoint;
inFile >> dec;
return 0;
}
This is the output:
Last login: Sat Aug 9 16:24:36 on ttys003
/Users/lucasmoderacki/sample/build/Release/sample ; exit;
macintosh:~ lucasmoderacki$ /Users/lucasmoderacki/sample/build/Release/sample ; exit;
logout
[Process completed]
#include <iostream>
#include <fstream>
using namespace std;
int main (int argc, char * const argv[])
{
double dec;
ifstream inFile;
inFile.open ("sample.txt");
inFile >> fixed >> showpoint;
inFile >> dec;
return 0;
}
This is the output:
Last login: Sat Aug 9 16:24:36 on ttys003
/Users/lucasmoderacki/sample/build/Release/sample ; exit;
macintosh:~ lucasmoderacki$ /Users/lucasmoderacki/sample/build/Release/sample ; exit;
logout
[Process completed]
