Thread: sizeof operator

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    2

    sizeof operator

    without using sizeof operator how can i get the sizeof the variables

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    int a[2];
    char* start = (char*) a;
    char* end = (char*)&a[1];
    end-start is sizeof a[0]
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  2. Replies: 6
    Last Post: 10-15-2007, 08:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Replies: 14
    Last Post: 06-28-2006, 01:58 AM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM