hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye, 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"
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sweety |
last post by:
plz reply,
thanks in advance.
bye,
|
by: Sweety |
last post by:
hello,
how to use macro to calculate the sizeof some data types.
plz explain .
thanks in advance.
bye,
|
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() {...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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) ?...
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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,...
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |