You return it the same way, whether you define it "inside" the class or "outside".
"The compiler complains" is a crappy explanation. Exactly what is your compiler's complaint? If I were your compiler, I'd complain, too. The first example has "return Room" while the second has "return foo". Why don't you give us a small, but complete, snippet that fails. I mean real code. The real stuff the compiler doesn't like. Include with it the real reason that it fails. Neither we nor the compiler are mind readers, and I can't see your monitor from my house.
Last edited by DaWei; 17Jun2007 at 18:19..