I have here the the cpp file named as clock
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#include <cstdlib>
int main() {
// ofstream constructor opens file
ofstream outClientFile("clients.dat", ios::out);
if(!outClientFile) {
cerr << "File could not be opened" << endl;
exit(1);
}
cout << "Enter the account, name, and balance.\n"
<< "Enter end-of-file to end input.\n? ";
int account;
string name;
double balance;
while(cin >> account >> name >> balance) {
outClientFile << account << ' ' << name
<< ' ' << balance << '\n';
cout << "? ";
}
return 0; // ofstream destructor closes file
}
and the name as timefetch.cpp
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int main() {
// ofstream constructor opens file
ofstream outClientFile("bible13.txt", ios::out);
if(!outClientFile) {
cerr << "File could not be opened" << endl;
exit(1);
}
clock_t start = clock();
for (int i = 0; i<50000; i+=5000)
{
cout<< i << endl;
}
clock_t end = clock();
double runningTime = (double) (end - start) / (double) CLOCKS_PER_SEC;
cout<<"The running Time is"<<runningTime;
system ("pause");
return 0;
}
the result are 2 errors naming:
Error 1 error LNK2005: _main already defined in Fetch.obj Clock.obj
Error 2 fatal error LNK1169: one or more multiply defined symbols found C:\Documents and Settings\Aldrich Uy\My Documents\Visual Studio 2005\Projects\clock sort\Debug\clock sort.exe 1
what should I do pls. help me