C++: Cannot convert from foo& to foo*
- by Rosarch
I have a method:
odp(foo& bar);
I'm trying to call it:
foo baz;
odp(&baz);
I get a compiler error:
error C2664: "odp" cannot convert parameter 1 from 'foo *' to 'foo &'
What am I doing wrong? Aren't I passing in a reference to baz?
UPDATE: Perhaps I have a misconception about the relationship between pointers and references. I thought that they were the same, except references couldn't be null. Is that incorrect?