Question why is this not working?
//***********************************************
// Input
//
// Noll Roberts 2009-11-12
/*
*/
//************************************************
#include <iostream> // endl cout
#include <iomanip> // setw
#include <fstream> //
#include <string> // string variables
using namespace std;
int main (int argc, char * const argv[]) {
//Declarations
float a;
float b;
float c;
// Input
ifstream inData;
inData.open("data.dat");
if (!inData)
{
cout << "Can't open input file." << endl;
return 1;
}
inData >> a;
inData >> b;
inData >> c;
return 0;
}
data file
19.5 18.7 19
I added the data file to my Xcode project
error message
/Users/nollroberts/Xcode/indata/build/Release/indata ; exit;
noll-roberts-imac-2:~ nollroberts$ /Users/nollroberts/Xcode/indata/build/Release/indata ; exit;
Can't open input file.
logout
[Process completed]
Question
Why is this not working?
//***********************************************
// Input
//
// Noll Roberts 2009-11-12
/*
*/
//************************************************
#include <iostream> // endl cout
#include <iomanip> // setw
#include <fstream> //
#include <string> // string variables
using namespace std;
int main (int argc, char * const argv[]) {
//Declarations
float a;
float b;
float c;
// Input
ifstream inData;
inData.open("data.dat");
if (!inData)
{
cout << "Can't open input file." << endl;
return 1;
}
inData >> a;
inData >> b;
inData >> c;
return 0;
}
data file
19.5 18.7 19
I added the data file to my Xcode project
error message
/Users/nollroberts/Xcode/indata/build/Release/indata ; exit;
noll-roberts-imac-2:~ nollroberts$ /Users/nollroberts/Xcode/indata/build/Release/indata ; exit;
Can't open input file.
logout
[Process completed]
Question
Why is this not working?