473,472 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Should I include this <stddef.h> ?

Hi, all.
I'm in Fedora Core 4 .I noticed that a lot of types are defined in
stddef.h of Stantard C.
I usually include files from /usr/include , but my stddef.h looks like
in /usr/lib/gcc/i386-redhat-linux/4.0.0/include/stddef.h.
Should I include the file from that path?? I noticed people never
include from that path.(Also in many linux programming books)

I see ptrdeff_t or size_t or ssize_t also defined in other head files
of /usr/include.

Feb 17 '06 #1
2 2459
"Roka" <Ro*****@gmail.com> writes:
I'm in Fedora Core 4 .I noticed that a lot of types are defined in
stddef.h of Stantard C.
I usually include files from /usr/include , but my stddef.h looks like
in /usr/lib/gcc/i386-redhat-linux/4.0.0/include/stddef.h.
Should I include the file from that path?? I noticed people never
include from that path.(Also in many linux programming books)

I see ptrdeff_t or size_t or ssize_t also defined in other head files
of /usr/include.


You should just use "#include <stddef.h>". Let your compiler figure
out where to find it. Specifying the location will just make your
code non-portable (it will probably be in a different place next time
you upgrade your compiler, and it will almost certainly be in a
different place on a different system).

The C language itself says nothing about a /usr/include directory;
that's just a Unix convention.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 17 '06 #2
Roka wrote:
Hi, all.
I'm in Fedora Core 4 .I noticed that a lot of types are defined in
stddef.h of Stantard C.
I usually include files from /usr/include , but my stddef.h looks like
in /usr/lib/gcc/i386-redhat-linux/4.0.0/include/stddef.h.
Should I include the file from that path?? I noticed people never
include from that path.(Also in many linux programming books)

A little OT, but compilers have their own rules about include file
search paths, you may find yours will find <stddef.h> in that directory.

--
Ian Collins.
Feb 17 '06 #3

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

Similar topics

2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
18
by: Tuckers | last post by:
My question is, if I have created my own library which lives in its own install directory, to refer to its header file is it better to use #include "MyLibrary.h" or #include <MyLibrary.h> ...
9
by: bill | last post by:
Forget the exact definition of difference between, #include <foo.h> and #include "bar.h" Normally foo.h is a standard header file, so it's path is not defined in compiler option, but I...
2
by: Martin Hvidberg | last post by:
Dear list I have found a declaration like this: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #include "ectemp.h"
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
13
by: Sebastian Faust | last post by:
Hi, I hava a somehow strange problem. I hope I am not wrong in this group; if this is the case please let me know. I am trying to compile a rather simple C program. As long as I use: #include...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
12
by: Pablo Suarez | last post by:
When I code #include "myheader.h" then this header file is searched in the current directory. But where does the compiler search the header file when I write #include <myheader.h>
4
by: saneman | last post by:
I have a folder 'app' containing a file 'main.cpp' and a subfolder 'types' (containing various header files). In main.cpp some header files from the subdir 'types' are included like: 1)...
0
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
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
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...
0
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 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.