answersLogoWhite

0

It's a compiler directive that is ignored by all standards-compliant C compilers. The C++ compiler uses the directive to determine that the code that follows should be treated as being C rather than C++. Most X.h standard library headers in C also have a corresponding cX header in C++, such that <math.h> in C is <cmath> in C++. The C++ header simply imports the extern "C" header into the std namespace and thus avoids pollution of the global namespace.

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

How do you create an header file in c with example?

Any file can be called a header. Whenever someone uses #include , it's the same as copy/pasting that file in that spot. Typically though, they call it a header if it's included at the beginning of your source.


What is headderfile in c language?

Header File in C/C++ are the files which contains the definition of the pre-defined functions, data-types &amp; constants, etc. By adding the header file you reduce your job of defining the same functions which are defined earlier by someone else &amp; you can use those functions/data-types easily.


What is header file in computer programming?

A header file is used in some languages to declare functions that will be used but are not yet defined in the current source code. This is primarily used by C and C++, and usually for library functions and user-defined functions that are stored in separate files and folders than the main source code file.


Is a header file a collection of built in functions that help in writing c programs?

No. There are no built-in functions in C, there are only built-in types and built-in operators for those types. All functions are user-defined, including those defined by the C standard library. There are no user-defined operators in C, but you can implement operators as named functions if required. A header file (*.h file) typically contains a group of related user-defined function and/or user-defined type declarations which can be included in any source file that requires them. Every user-defined function or user-defined type name used by a program must have one (and only one) definition, usually contained in a corresponding source file (*.c file) or library file (*.lib file). Built-in types and their corresponding operators do not require a header file since they are part of the language itself (hence they are built-in).


Which header file should be included in c to enable string conversion?

What conversion do you mean? For example strtol is defined in stdlib.h, sprintf is defined in stdio.h.


What header file should include to enable string conversion in c?

What conversion do you mean? For example strtol is defined in stdlib.h, sprintf is defined in stdio.h.


How do you include an user defined header file that is located in a directory?

Every header file is located in a directory. You use a compiler option (-I) to specify include directory to the compiler.Example:gcc -W -Wall -pedantic -I/my/favourite/directory -o prog.o -c prog.c


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.


Can an extern function be defined in a C header file?

Declared is the right word. (Don't define functions in headers, unless you really know what you are doing.)


Can Header file be called in main function or not?

No, main.c does not require a header file. When you have a ".c" and ".h" pair, the ".h" file is to declare the existence of functions that are defined in the ".c" files so that these functions can be called in other files. since "main.c" needs the headers of the other modules (to access their data types and functions) but usually doesn't have a header file itself.Header files aren't "called", they are "included",but usually not inside any function.


In a header file whether functions are declared or defined?

Ideally, functions should only be declared in a header and defined in a translation unit (source file) that includes the header. However, trivial functions are often defined in a header as they are usually good candidates for inline expansion, but you must remember to declare the function inline. Often it is better to forward declare inline functions so that maintainers are not distracted by the implementation details which can be placed towards the end of the header, out of the way. However, a definition is also a declaration, so forward declaring an inline function is not a requirement unless there is a cyclic dependency issue where a forward declaration is necessary to break the cycle.


How many types in header file in mathh header file in c language?

Look for typedef in it, but I don't think you will find any.