sizeof operator

This is a discussion on sizeof operator within the C Programming forums, part of the General Programming Boards category; without using sizeof operator how can i get the sizeof the variables...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    int a[2];
    char* start = (char*) a;
    char* end = (char*)&a[1];
    end-start is sizeof a[0]
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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, 08:05 AM
  2. Replies: 6
    Last Post: 10-15-2007, 09:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  4. Replies: 14
    Last Post: 06-28-2006, 02:58 AM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-07-2003, 12:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21