19

I'm very new to Ubuntu. I'm looking at the directory /usr/include it contains lot of header files. I know they have specified certain constants and other information that are used in Ubuntu. I'm confused with the use of it.

One of the directory inside is linux/byteorder. Which has two files:

big_endian.h  little_endian.h

I wonder why two files are needed? My machine will be either big endian or little endian right? Didn't ubuntu while installation didn't pick my system byte order? Does /usr/include is just same for all machines? What is the exact use of it?

Thanks in advance.

3 Answers 3

21

That folder includes the header files for C compilers. Such as "stdio.h", "stdlib.h" etc.

When you type header information in the C source file such #include <stdio.h> the compiler will look for the file in /usr/include directory by default.

big_endian.h and little_endina.h files are included, because though your computer may be of only one kind, you can cross-develop application for both architecture. So, you need both header file.

2
4

These files are needed when you compile programs, be that a software package you need to compile manually or your own programs. They are included in the C code such that you can use the functions defined there. Don't worry about them if you don't code.

1

Yes but you may decide to develop a cross platform app.

And when you write program for the other machine which is different endian than yours. Then may be these files are used to compile such programs. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .