How to Read a File into a 2D Array?

I am new to C++, and new to programming altogether. I'm finishing up my first semester as a Computer Science major, but I'm struggling with programming.

I need to read a file into a 2D array.

Here is what the file contains (90 characters):
S
R
R
S
R
R
R
R
S
S
S
S
C
S
C
C
R
C
R
R
S
C
R
C
C
S
C
S
S
R
S
C
C
C
S
C
R
R
R
S
R
C
S
R
S
C
C
R
C
C
C
C
C
R
R
R
C
R
R
C
C
R
S
S
C
R
R
C
R
R
S
C
R
R
S
S
R
R
R
R
R
C
S
C
C
R
S
R
R
R


Here is my current code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

const int MONTHS = 3;	//Number of months
const int DAYS = 30;	//Number of days in each month
const int SIZE = 90;	//Total number of days

void readFunction(char[], string[DAYS]);   //readFunction prototype

int main()
{
	char weatherArray[SIZE];	    //Array for the weatherFile data
	string summerArray[MONTHS][DAYS];   //Array for the 3 months and 30 days in each month

	readFunction(weatherArray, summerArray);

	return 0;
}

void readFunction(char weatherArray[], string summerArray[][DAYS])   //Reads weatherFile into summerArray
{
	int row = 0,		//Loop counter for rows
		col = 0;	//Loop counter for columns
	ifstream weatherFile;	//Weather file

	for (row = 0; row < MONTHS; row++)
	{
		for (col = 0; col < DAYS; col++)
		{
			weatherFile.open("RainOrShine.dat");
			summerArray[row][col] = weatherFile;
		}
	}
	weatherFile.close();
}


Here is my list of errors:
Error 1 error C2664: 'void readFunction(char [],std::string [])' : cannot convert argument 2 from 'std::string [3][30]' to 'std::string []' (line 17)
Error 2 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::ifstream' (or there is no acceptable conversion) (line 33)

Could someone please explain to me what I'm doing wrong, and how to fix it?
Thank you in advance!
1)
1
2
void readFunction(char[], string[DAYS]);
void readFunction(char weatherArray[], string summerArray[][DAYS]) 
find the difference.

2) summerArray[row][col] = weatherFile; you are trying to assign file to char there. Maybe you want to read from it.
Okay, I fixed the first problem. I guess I just overlooked that. Thank you for pointing it out!

As for the second problem, I don't know how to read a file into a 2D array. I realize I cannot assign the 2D array into a character, but I don't know what to do.
Same as you would read a character from a file stream:
1
2
3
4
5
6
7
8
char c; //A character
summerArray; //A 2D array
summerArray[x]; //A 1D array of char
summerArray[x][y]; //A char

weatherFile >> c; //Read character from file
//Same with summerArray
//??? 
Thank you! I'm sorry for my inexperience and lack of common sense. You will probably be seeing me in the forum more than you care to.
Topic archived. No new replies allowed.