you declare a 2d array of strings like this
const int ROWS = 255;
const int CHARS_PER_ROW 20
char array[ROWS][CHARS_PER_ROW];
then it looks like this
char get(char array[ROWS][CHARS_PER_ROW])
{
ifstream fin("input.txt");
if( fin.is_open())
{
int row = 0;
while( row < ROWS && fin >> array[row++] )
;
}
return 0;
}
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
This link might help you understand a little more.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
I’ve worked it out now so don’t worry about it!
ta
Yea I know all about that type of problem, I just spent three days trying to find one like that in my own program.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343