·¢¼þÈË: "Guo Congbin" <gu********@sei.buaa.edu.cn>
Ö÷Ìâ: is size_t a keyword?or a macro?
ÈÕÆÚ: 2004Äê6ÔÂ17ÈÕ 23:04
if size_t is a macro, where is the defination? i look it up in the stddef.h,
but i find nothing about size_t.
this is the content of stddef.h of my system,
#ifndef _LINUX_STDDEF_H
#define _LINUX_STDDEF_H
#undef NULL
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#undef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
i regard the size_t as unsigned int or unsigned long, and i am not very
confidence.
Please help me!
yours Guocongbin
2004.6.17 4 3018
"Guo Congbin" <gu********@sei.buaa.edu.cn> wrote in message
news:ca**********@mail.cn99.com... ·¢¼þÈË: "Guo Congbin" <gu********@sei.buaa.edu.cn> Ö÷Ìâ: is size_t a keyword?or a macro? ÈÕÆÚ: 2004Äê6ÔÂ17ÈÕ 23:04
if size_t is a macro, where is the defination? i look it up in the
stddef.h, but i find nothing about size_t.
this is the content of stddef.h of my system, #ifndef _LINUX_STDDEF_H #define _LINUX_STDDEF_H
#undef NULL #if defined(__cplusplus) #define NULL 0 #else #define NULL ((void *)0) #endif
#undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
i regard the size_t as unsigned int or unsigned long, and i am not very confidence.
size_t *should* be defined in <stddef.h>, and several other headers,
as a type (with a typedef).
P.J. Plauger
Dinkumware, Ltd. http://www.dinkumware.com
Guo Congbin wrote: this is the content of stddef.h of my system, #ifndef _LINUX_STDDEF_H #define _LINUX_STDDEF_H
That's an internal header, used, I think, when building the Linux
kernel. Look for the stddef.h that comes with your compiler. On my Linux
system it's in /usr/lib/gcc-lib/i386-redhat-linux/2.96/include.
--
Pete Becker
Dinkumware, Ltd. ( http://www.dinkumware.com)
Guo Congbin wrote: ·¢¼þÈË: "Guo Congbin" <gu********@sei.buaa.edu.cn> Ö÷Ìâ: is size_t a keyword?or a macro? ÈÕÆÚ: 2004Äê6ÔÂ17ÈÕ 23:04
if size_t is a macro, where is the defination? i look it up in the stddef.h, but i find nothing about size_t.
this is the content of stddef.h of my system, #ifndef _LINUX_STDDEF_H #define _LINUX_STDDEF_H
#undef NULL #if defined(__cplusplus) #define NULL 0 #else #define NULL ((void *)0) #endif
#undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
i regard the size_t as unsigned int or unsigned long, and i am not very confidence.
Please help me!
yours Guocongbin 2004.6.17
In C++ size_t is a typedef of a built in unsigned integral type defined
in <cstddef>.
Best regards,
Ioannis Vranos
Ioannis Vranos wrote: In C++ size_t is a typedef of a built in unsigned integral type
and is
defined in <cstddef>.
Best regards,
Ioannis Vranos This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Guo Congbin |
last post by:
if size_t is a macro, where is the defination? i look it up in the stddef.h,
but i find nothing about size_t.
this is the content of stddef.h of my system,
#ifndef _LINUX_STDDEF_H
#define...
|
by: Newbie_sw2003 |
last post by:
Where should I use them?
I am giving you my understandings. Please correct me if I am wrong:
MACRO:
e.g.:#define ref-name 99
The code is substituted by the MACRO ref-name. So no overhead....
|
by: javadesigner |
last post by:
Hi:
I am a bit new to C programming and am trying to
write a wrapper around malloc. Since malloc takes
size_t as it's parameter, I want to be able to
see if my function recieved an argument...
|
by: Xenos |
last post by:
Is there a standard way to determine the max. value of size_t as a
compile-time constant? Will:
#define SIZE_T_MAX ((size_t) -1)
work in all cases, or just on 2s comp. machines?
DrX
|
by: siliconwafer |
last post by:
Hi all,
I wanted to know that is use of extern keyword mandatory in case of
global variables and functions used in other source files?
i.e consider a following piece of code from MSDN explaining...
|
by: sounak |
last post by:
How could we get a macro name from a macro value
such that
in a header file
#define a 100
#define b 200
now the source file will be such that
the user gives 100
then the value is outputted as...
|
by: Morgan |
last post by:
Hi all,
I was messing around with someone elses script when I noticed that he
had used the in keyword in an if conditional to compare a string with a
object. I've never seen this used and was...
|
by: sam_cit |
last post by:
Hi Everyone,
I was looking at the function prototype of malloc() function in
stdlib.h and i found that to be,
void *malloc(size_t size);
so what is size_t is it a pre-defined typedef to...
|
by: subramanian100in |
last post by:
Consider the following program
#include <limits.h>
#include <stddef.h>
int main(void)
{
size_t size;
size_t bytes = sizeof(size_t);
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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: 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...
| |