Segmentation Fault ostream overload

Hello everyone,

I' ve seen post on this topic before, but this is a liiiitle different.

So the question on the already asked topics is why do I get segmentation fault when overloading ostream. It's because I haven't dereferenced the ostream object.

Example: lets say that i have class iterator


ostream operator*(ostream& a,const iterator & a ){

return a;//okay
}

Now, what if I have a struct iterator and a request for operator that outputs that struct like this : cout<<*i;

Now my operator would look like this:

ostream operator*(){

}

HOW can I dereference ostream here?
Topic archived. No new replies allowed.