T
Tatu Portin
1: #include <iostream>
2:
3: typedef struct {
4: double r;
5: double i;
6: } complex;
..
..
..
24: ostream & operator<< (ostream &str, const complex &a)
25: {
26: s << "(" << a.r << " + i" << a.i ")";
27: return s;
28: }
when compiled with gcc:
I think this error has something to do with that 'ostream'. I have #included
<iostream>, so that should not cause this?
2:
3: typedef struct {
4: double r;
5: double i;
6: } complex;
..
..
..
24: ostream & operator<< (ostream &str, const complex &a)
25: {
26: s << "(" << a.r << " + i" << a.i ")";
27: return s;
28: }
when compiled with gcc:
complex.cc:24: syntax error before `&' tokengcc complex.cc
I think this error has something to do with that 'ostream'. I have #included
<iostream>, so that should not cause this?