My program is this. It will not compile because it says that there is an error with clrscr(). Can anyone help?
Code:
#include <iostream>
#include <fstream>
#include <conio.h>
#include "primes.h"
using namespace std;
long primes[1000000L];
int main(int argc, char* argv[])
{
number prime;
char pf[40];
long a,counter=0;
long aaaa=2000000000L;
cout << "Enter the name of the file to put primes into: ";
cin.get(pf, 400);
cin.ignore(80,'\n');
ofstream outfile;
outfile.open(pf,ios::out);
if(outfile)
{
for(a=2;a<=aaaa;a++)
{
prime.SetValue(a);
if (prime.isPrime())
{
clrscr();
outfile << a << endl;
counter++;
cout << counter;
}
if (counter==10000000L)
a=aaaa;
}
cout << "\nNumbers found";
cout << "\nDone";
outfile.close();
}
else
{
cout << "An error occured while opening the file.\n";
}
return 0;
}