expected initializer before '&' token

Hello,
I am getting this error:

expected initializer before '&' token

which references the line std::istream &operator >> (std::istream &in, Maze &m);

This is my 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
#ifndef MAZE
#define MAZE

#include <stdio.h>
#include <iostream>
#include <fstream>
#include <iomanip>

const int SIZE= 10;

class Maze
{
        public:
                void input (std::istream &in);          //read in the maze
                void output (std::ostream &out);        //output the maze

        protected:
                char cells[SIZE][SIZE];

}

#endif //MAZE_H
 
std::istream &operator >> (std::istream &in, Maze &m);
std::ostream &operator << (std::ostream &out, Maze m);


This is a header file to a class. I've seen similar problems on the web, but the solution has always been to put std:: in front of the istream. Please advise.
Last edited on
Asked and answered here:
http://www.cplusplus.com/forum/beginner/198165/

Please do not post the same question multiple times. It wastes people's time.
Topic archived. No new replies allowed.