From: Foster, G. <gar...@si...> - 2005-06-16 08:21:36
|
> What return type did you intend? C++ has no 'implicit int'. > It was sort of supposed to be a pseudo code example, I have based it on actual code, it is mearly there to draw out the descrepancy between the two compilers I mentioned. Put another way, I quickly hacked up an example scenario, and forgot to include the return type - probably because I had no intention of getting as far as returning anything :) So, without further ado ... class something { }; class example { public: something * m_p_something; // constructor + other boilerplate ... int somemethod() { something * p_something(m_p_something); // here cv ++ 6 complains that m_p_something is undeclared // my suspicion is that this is a misleading warning // the question is - is this legal c++ or a g++/mingw 'feature' something * p_otherthing = m_p_something; // this works fine on both g++/mingw and vc++ 6 // do some stuff etc return 0; } }; int main(int argc, char ** argv) { example myExample; example.somemethod(); return 0; } |