11011110110011011001100110011001000110011001100111010001011

September 10, 2008

a c++ code segment

Filed under: Programming

  #include   <iostream>  
  class   Controller  
  {  
  public:  
        void   print()  
        {   
             std::cout<<"good";  
        }  
  };  
  int   main(int   argc,   _TCHAR*   argv[])  
  {  
        Controller   *pCtrl;  
        pCtrl->print();  
        getchar();  
        return   0;  
  }

====

^_^, it runs good.

1 Comment »

The URI to TrackBack this entry is: http://lyo.blogsome.com/2008/09/10/a-c-code-segment/trackback/

  1. why does it work?
    pCtrl even hasn’t been initialized

    Comment by n5 — September 14, 2008 @ 9:13 pm

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.