i can't seem to output the array i filled with random numbers into a file like notepad or mircosoft word. idk if what I'm doing is even correct.. pls help ;/
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<ctime>
#include<string>
usingnamespace std;
int RowTest();
int ColumnTest();
void ArrayFiller();
string GetFileName();
void PrintArray();
int main()
{
int Row = RowTest();
int Column = ColumnTest();
int Array [50][50] ;
int FilledArray = ArrayFiller();
string FileName = GetFileName();
srand ((time(NULL)));
return(0);
}
int RowTest()
{
int Row;
do
{
cout << "Enter the number of rows you would like in the array, that is between 2 and 50 \n";
cin >> Row;
}
while ( (Row < 2) || (Row > 50) );
return (Row);
}
int ColumnTest()
{
int Column;
do
{
cout << "Please enter a value for the column of the array that is between 2 and 50.\n";
cin >> Column;
}
while ( (Column < 2) || (Column > 50) );
return (Column);
}
string GetFileName()
{
string FileName;
cout << " Please enter the name of the file \n";
cin >> FileName;
return(FileName);
}
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(FilledArray);
}
void PrintArray( ostream& out, int Array[50][50], int Row, int Column )
{
string FileName = GetFileName();
int FilledArray = ArrayFiller();
ofstream FileOut;
FileOut.open(FileName);
FileOut << FilledArray ;
}