void ArrayClass1::prompt(void)
{
cout << "How big do you want the array? " << endl;
cin >> size;
if (size < 1 )
cout << "Error: size of array too small" << endl;
a = new int (size);
for ( i=0; i<size; i++)
a[i] = (rand()%10000);
}//promt
// asks for size of desired array
// and allocates it, then fills it
// with random numbers
void ArrayClass1::print()
{
for ( i=0; i<size; i++)
printf ("array [%3d]:%5d\n", i , a[i]);
//printf ("[%s]" ,f);}//for
// prints out the array
// Uses sprintf() formatting to keep all
// the numbers nicely aligned vertically.
}//print
void ArrayClass1::createFile( char * filename)
{
ofstream stream;
stream.open("C:\\Documents and Settings\\1868272\\My Documents\\fp.txt");
for (int i = 0; i <size; i++)
{
stream << a[i] <<endl;
}//for loop
stream.close();//close the stream
for (int i = 0; i <size; i++)
{
cout << a[i] << endl;
}//for loop
system ("pause");
}//2file created
};//class end
int main (int argc, char *argv[], char **env)
{ if (argc <2)
{cout <<"Not the right amount of arguments on the command line"<<endl;
exit (-1);}//warning
ofstream fileName( "fp", ios::out );
if (!fileName )
{cerr << "File could not be opened" << endl;
exit(-1);}//warning