so i need to be able to have the user tell me a file to open, in that opened file, i need to write out the array that was filled with random integers. when i compile it i get loads of errors, help me ;/
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<ctime>
usingnamespace std;
int RowTest();
int ColumnTest();
int ArrayFiller();
int GetFileName();
int main()
{
int Row = RowTest();
int Column = ColumnTest();
int Array [50][50] ;
char FileName;
srand ((time(NULL)));
ofstream FileName;
FileName.open ( " The file you are opening is " << FileName << \n; )
FileName << ( ArrayFiller() );
FileName.close();
return(0);
}
int RowTest()
{
int Row;
cout << " Please enter a value for the row of the array that is between 2 and 50. \n";
cin >> Row;
if (1 >= Row || Row >= 51)
{
cout << " Invalid input, please try again \n";
}
else
{
}
return Row;
}
int ColumnTest()
{
int Column;
cout << " Please enter a value for the column of the array that is between 2 and 50 as well.\n";
cin >> Column;
while (1 >= Column || Column >= 51)
{
cout << " Invalid input, please try again \n";
}
return Column;
}
int ArrayFiller( int Array[50][50] , int Row , int Column )
{
for (int i = 0; i < Row; i++)
for (int k = 0; k < Column; k++)
{
Array[i][k] = rand() % 100;
}
return(ArrayFiller);
}
char GetFileName()
{
cout << " Please enter the name of the file \n";
cin >> FileName;
return(FileName);
}