473,507 Members | 12,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3248
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
4039
by: Sweety | last post by:
plz reply, thanks in advance. bye,
8
431
by: Sweety | last post by:
hello, how to use macro to calculate the sizeof some data types. plz explain . thanks in advance. bye,
27
2479
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
1452
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
1901
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
3020
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
15549
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
1665
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
2596
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
3546
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...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.