when I use this:
I get the following compile-time errors:Code:string reason( "connect() failed" ); throw ( logic_error( reason ) ); // this is line 65.
But using this:Code:C:\Ruchikar\RnD\wbsrvc1\Session.cpp(65) : error C2061: syntax error : identifier 'reason' C:\Ruchikar\RnD\wbsrvc1\Session.cpp(65) : error C2066: cast to function type is illegal C:\Ruchikar\RnD\wbsrvc1\Session.cpp(65) : error C2059: syntax error : ';'
works just fine! What's the difference?Code:throw ( logic_error( string( "connect() failed." ) ) );
I'm using MS VC++ on Win2K.
Thanks in advance.



LinkBack URL
About LinkBacks



Yes, I always was puzzled on why the first way didn't work and an almost identical second did not. The first 3 errors though usually mean the header file was missing.