Hello, as part of an exercise I wrote a piece of code to calculate some dimensions using data from a file. It worked in the lab where I was shown how to, for want of a better word, link the data file to the code I had written.
Now that I try it at home I can't remember how to do this. I guess I'm asking how I go about creating a data file.
At the moment when I run the code it says 'Cannot find or open the PDB file'. I'm using visual studio express 2013.
// Program Frame reads input values that represent the
// dimensions of a print from a file and calculates and
// prints the amount of wood needed for a frame..
#include <iostream>
#include <fstream>
usingnamespace std;
int main ()
{
ifstream din;
ofstream dout;
int side; // vertical dimension in inches
int top; // horizontal dimension in inches
int inchesOfWood; // inches of wood needed
din.open("frame.in");
dout.open("frame.out");
din >> side >> top;
dout << "Dimensions are " << top << " and "
<< side << "." << endl;
inchesOfWood = 2 * top + 2 * side;
dout << "You need " << inchesOfWood
<<" inches of wood." << endl;
system("pause");
return 0;
}