473,322 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

macro for sizeof

hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye,
Nov 14 '05 #1
4 3228
sw************@yahoo.co.in (Sweety) writes:
hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye,


You got several responses when you posted this same question two days
ago. If those responses weren't useful to you, you'll need to explain
why before we can help you.

It would also be helpful if you could tell us why you want to use a
macro rather than the builtin "sizeof" operator.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 14 '05 #2
Keith Thompson <ks***@mib.org> scribbled the following:
sw************@yahoo.co.in (Sweety) writes:
hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye,
You got several responses when you posted this same question two days
ago. If those responses weren't useful to you, you'll need to explain
why before we can help you. It would also be helpful if you could tell us why you want to use a
macro rather than the builtin "sizeof" operator.


Because his teacher asked him to?

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"This is a personnel commuter."
- Train driver in Scientific American
Nov 14 '05 #3
In <c4**********@oravannahka.helsinki.fi> Joona I Palaste <pa*****@cc.helsinki.fi> writes:
Keith Thompson <ks***@mib.org> scribbled the following:
sw************@yahoo.co.in (Sweety) writes:
hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye,

You got several responses when you posted this same question two days
ago. If those responses weren't useful to you, you'll need to explain
why before we can help you.

It would also be helpful if you could tell us why you want to use a
macro rather than the builtin "sizeof" operator.


Because his teacher asked him to?


It's a horrible homework assignment, except for a course in *advanced* C
programming. Otherwise, the only solution a teacher can realistically
expect is:

#define SIZEOF sizeof

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #4
On Tue, 6 Apr 2004, Joona I Palaste wrote:
Keith Thompson <ks***@mib.org> scribbled the following:
sw************@yahoo.co.in (Sweety) writes:
hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye,
You got several responses when you posted this same question two days
ago. If those responses weren't useful to you, you'll need to explain
why before we can help you.

It would also be helpful if you could tell us why you want to use a
macro rather than the builtin "sizeof" operator.


Because his teacher asked him to?


Or because he/she found a set of interview questions without the answers.
He/she is worried this might be a question they will ask during an
interview.
--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"This is a personnel commuter."
- Train driver in Scientific American


--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@whitehouse.gov
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sweety | last post by:
plz reply, thanks in advance. bye,
8
by: Sweety | last post by:
hello, how to use macro to calculate the sizeof some data types. plz explain . thanks in advance. bye,
27
by: Ken Human | last post by:
I want to generate every possible 16 character combination of the characters 0-9, A-Z, and a-z programatically. My current code follows: #include <stdio.h> #include <ctype.h> int main() {...
4
by: ethan | last post by:
Hi All, I'd like ask some question about macro. If I define a variable set, such as {5, 2, 10} or {1,3}. #define X {5,2,10} 1) Is it possible to write a macro to get the number of items...
4
by: Garry Freemyer | last post by:
I'm trying to convert this macro to a c# function but I have a big problem. It's on the LEFT side of an assignment statement and I am extremely flustered over this one because I'm a little rusty...
11
by: Richard Meister | last post by:
Hi, I'd like to define several constants and make sure that all of them are smaller than a given other constant. I thought this could be done by a simple macro. Something like this: #define...
13
by: Rick Anderson | last post by:
Group, I want to define a #include directive from another macro, if possible... For example, the following doesn't work but is basically what I need to do: #define...
2
by: Bit Byte | last post by:
I've come accross the following macro: #define ARR_DIMS(a) \ 66 ((int *) (((char *) (a)) + sizeof(ArrayType))) I know what it means (from reading the rest of the code)., but I wonder could...
6
by: pedroalves | last post by:
Hi all, This is not a question about how to #define COMMA , Please keep reading. Recently in binutils, we introduced a macro like this: #define STRING_COMMA_LEN(STR) \ (STR), ((STR) ?...
12
by: Martin Wells | last post by:
I'm trying to come up with a fully-portable macro for supplying memset with an unsigned char rather than an int. I'm going to think out loud as I go along. . . I'll take a sample system before I...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.