CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Threaded View

  1. #1
    Join Date
    Jan 2009
    Posts
    1,689

    Any difference in the binary?

    Code:
    class foo {
    public:
       foo(void) : f1("test"), f2(5){}
    private:
       string f1;
       int f2;
    }
    
    class bar {
    public:
       bar(void) : f2(5), f1("test"){}
    private:
       int f2;
       string f1;
    }
    Does the order make any difference in performance?


    Also, any difference in this?

    Code:
    void * ptr = NULL;
    if (ptr){  something }
    
    ...
    
    if (ptr != NULL) { something }
    different compilers warn about these things, but I'm almost certain all compilers would be smart enough to do the != NULL implicitly.
    Last edited by ninja9578; January 31st, 2011 at 06:06 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured