Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- class Foo
- {
- public:
- Foo( char const * msg ) : x( y )
- {
- y = msg;
- }
- std::string const & x;
- private:
- std::string y;
- };
- int main( int argc, char * argv[] )
- {
- if ( argc >= 2 )
- {
- Foo f( argv[1] );
- std::cout << f.x << std::endl;
- }
- }
Add Comment
Please, Sign In to add comment