If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > How to implement sizeof() operator

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-04, 07:22
Neelima_thota Neelima_thota is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
How to implement sizeof() operator

Hi,
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.
Awaited
Neelima
Reply With Quote
  #2 (permalink)  
Old 09-08-04, 15:53
AceOmega AceOmega is offline
Registered User
 
Join Date: Apr 2004
Location: Arizona
Posts: 49
???

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.
Reply With Quote
  #3 (permalink)  
Old 09-12-04, 01:16
Neelima_thota Neelima_thota is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
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.
Thanks.
Reply With Quote
  #4 (permalink)  
Old 09-12-04, 11:35
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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.

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On