Thread: strange!

  1. #16
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Anddos: I was just testing the invocation of constructor! And yes Alpha* will leave no doubts. But I was just experimenting.

    CornedBee: Yeah Java is not C++. But C++ care for efficiency, much more than Java, so I was little surprised.

    Mats: Yeah, I understand now, global objects are initialized before main.

    laserlight: Thanks! Now I understand the order of the things!

    Elysia: Should I quote you again? Um... leave it. It's been quoted 8 times already! Thanks!

    Thanks all!

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Hehe, btw, the reason the constructor is called is because it would otherwise leave the object in a "zombie state." When an object is created, it needs to initialize itself. It's an object, after all. Just like your console and your computer, it needs to "start itself up."
    And because alpha is part of beta, it needs to "start itself up" so it can be used within beta.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by manav View Post
    CornedBee: Yeah Java is not C++. But C++ care for efficiency, much more than Java, so I was little surprised.
    But this is about efficiency. C++'s ability to allocate objects directly - in static memory or on the stack - is a key efficiency point of C++ over Java.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strange error -- COM DLL is not installed correctly?
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 07-16-2007, 08:32 AM
  2. Strange results using dnsapi and windns
    By Niara in forum Networking/Device Communication
    Replies: 3
    Last Post: 08-13-2005, 10:21 AM
  3. Strange response from MSVC
    By VirtualAce in forum Game Programming
    Replies: 2
    Last Post: 04-17-2004, 07:40 AM
  4. Very strange bug...
    By JaWiB in forum Tech Board
    Replies: 6
    Last Post: 04-27-2003, 01:56 PM
  5. bcc32 compiling error (really strange!!)
    By jester in forum C++ Programming
    Replies: 14
    Last Post: 01-26-2002, 04:00 PM