answersLogoWhite

0


Best Answer

Header files are actual files - stored in the file system, referenced by file name, and #include'd in other files (at least, in C/C++ or other languages using the M4 macro preprocessor). Header files typically group pieces of code that are all interdependent parts of the same specific item together. For instance, a game might have a header file for all of its graphics rendering.

Namespaces, on the other hand, are an element of the programming language - they don't exist as a file system object, but rather as a designation within code telling the compiler that certain things are within that namespace. Namespaces typically group interfaces (functions, classes/structs, types) of similar (but not necessarily interdependent) items. For instance, the std namespace in C++ contains all of the Standard Library functions and classes.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between header files and namespace in cpp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Header files in Java programming?

Java does not require header files like C/C++.


What are the Names of header files in java?

Java doesn't use header files.


Where headers files are generally stored?

It depends on the header file and on the general organization of the project. System header files, such as stdio.h or windows.h, are stored in a directory that the compiler knows about, but that you don't need to even think about. Library header files are either stored in the same place that system header files are stored, or they are stored in a place reserved for the particular library. In the latter case, there will usually be build parameters that identify the header files and their associated library files. User header files are either stored in the same directory as the source files, or they can be stored in a related directory, somewhere in the project directory tree. well in most of the DOS/Windows C/C++ compilers predefined header files are stored in INCLUDE directory of the folder containing the compiler


Why to use header file to easy know?

in the java as we use the inheritance property in the same way we can get the the inheritance property in c by using the prepared header files( .h files). there a single program in c use the many methods of many header files like math.h give us to use the use of floor(), sqrt() e.t.c. functions..


Why you use header files in c?

the use of header files is to add functionality. Header files are basically saying put code in that header file here so you don't have to type that many lines of code.

Related questions

Why are header files not required when using far and near pointers?

In C programming, header files are required. It doesn't matter if you are using near pointers, far pointers, both, or neither -- you still need header files. There is no connection between the necessity of header files and the pointers' size.


Header files in Java programming?

Java does not require header files like C/C++.


What are the Names of header files in java?

Java doesn't use header files.


How many header files in c?

Platform dependent, usually between 10 and 10,000.


Number of header files in c?

Platform dependent, usually between 10 and 10,000


What is the use of DOS header files in graphics?

It shows the header information..


Why is it necessary to include header files in C?

It isn't necessary to include header files in C. However, without the functionality provided by some header files, your program wouldn't be able to do very much that is useful.


How can you create a c program without using header file?

C programs do not require header files. If you want a C program without header files, you can simply not create them. However, you may or may not be able to include your non-header file source files.


Is header file the library file?

No. Header files are those which contains declaration part of function & library files are those which contains definition part of function. These are those functions which we called in our program by using header files.


When is header file executed and why?

Never, and the reason is that header files are not meant to be executed.


Explain about header files used in c language?

list of header files in c and function prototype associated with each file


What is the use of header files as used in C programming?

Header files are used to have declarations. It is simple to include a single header file than writing all the needed functions prototypes.