Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004

    Unanswered: How to implement sizeof() operator

    I would like to know how can i implement sizeof() operator.Can anyone please give me the code and alos i would like to know how to know the size of a structure without using sizeof() operator.

  2. #2
    Join Date
    Apr 2004


    First What Language and or SQL database are you using?

    Can't really help without that info.

    I use SizeOF commands to determine the dimentions of my variables when loading data into memory from a database. You can also, depending on the database system yu are using, get the dementions of the fields directly from the schema data. Some databases have system level tables which contain things like the triggers, procedures, and schemas where you can access that information directly.

    With out more information on what you are trying to do, we can not be much help.

  3. #3
    Join Date
    Sep 2004
    Thanks for helping me out.I would like to know the implementation of sizeof() keyword in C language .Hope you will help me out regarding this problem.

  4. #4
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    In C, the sizeof pseudo-function actually evaluates at compile time, not at run time. Most compilers treat it as a compile time directive (much like a #define) that resolves to a lookup into the symbol table for the referenced symbol that returns the target object's size in bytes as stored in the symbol table.

    There are a number of public domain C compilers. I'd recommend checking out gcc from gnu to see a nice clean implementation.


Posting Permissions

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