Thread: size of Object c++ compile problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    You also need to put in something to take care of that static data member:

    Code:
    int X::sa;
    Finding out the size should be a simple matter of using the sizeof operator:

    Code:
    cout << "Size of X is: " << sizeof(X) << endl;
    cout << "Size of Y is: " << sizeof(Y) << endl;
    Last edited by hk_mp5kpdw; 04-06-2005 at 12:14 PM.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. Error with a vector
    By Tropicalia in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2006, 07:45 PM
  3. Trouble with DMA Segmentation Faults
    By firestorm717 in forum C Programming
    Replies: 2
    Last Post: 05-07-2006, 09:20 PM
  4. Invalid conversion from 'void*' to 'BYTE' help
    By bikr692002 in forum C++ Programming
    Replies: 9
    Last Post: 02-22-2006, 11:27 AM
  5. DirectMusic engine problem
    By VirtualAce in forum Game Programming
    Replies: 7
    Last Post: 03-17-2005, 06:12 PM