keep getting fatal error LNK 1104

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.

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
int shirtsNum[5], postersNum[5], recordsNum[5];
float shirtsPrice[5], postersPrice[5], recordsPrice[5];
string venue[5];

ifstream fin;"merch.txt"); //opens file that data will come from

int z=0;


ofstream fout;"salesresults.txt"); //opens files where data will be sent

for(int y=0; y<10; y++)
fout<<"Total sales for "<<venue[y]<<" is:";

return 0;
Please post the full error text. Also, you should use [code] tags around your code.
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>Build FAILED.
1>Time Elapsed 00:00:12.37
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
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.
Topic archived. No new replies allowed.