Feb 17, 2013 at 7:23pm UTC
I'm not sure what I've done wrong, but my program won't run. It doesn't seem to be a problem with the syntax.
using namespace std;
int shirtsNum, postersNum, recordsNum;
float shirtsPrice, postersPrice, recordsPrice;
fin.open("merch.txt"); //opens file that data will come from
fout.open("salesresults.txt"); //opens files where data will be sent
for(int y=0; y<10; y++)
fout<<"Total sales for "<<venue[y]<<" is:";
Feb 17, 2013 at 8:06pm UTC
Please post the full error text. Also, you should use [co
de] tags around your code.
Feb 17, 2013 at 8:46pm UTC
This is the error text that is shown:
1>------ Build started: Project: Proj1, Configuration: Debug Win32 ------
1>Build started 2/17/2013 2:43:35 PM.
1> Touching "Debug\Proj1.unsuccessfulbuild".
1> All outputs are up-to-date.
1>LINK : fatal error LNK1104: cannot open file 'C:\Users\CK\Documents\Visual Studio 2010\Projects\Proj1\Debug\Proj1.exe'
1>Time Elapsed 00:00:12.37
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Feb 17, 2013 at 9:00pm UTC
Compiles fine for me with VS2010.
Some notes on your code:
1) You don't check that the open of your input file succeeded.
2) What happens if z exceeds 5?
3) In your second loop, you are indexing past the bounds bounds of your arrays regardless of how many items your read.