answersLogoWhite

0

C programs don't have a definition section as such. C source files are composed from declarations and definitions, however the only requirement is that all user-defined identifiers be declared before they are used; the definition itself can literally be placed anywhere. However, a definition is itself a declaration so we really only need declarations when a definition is used by two or more source files or where two or more definitions refer to each other (cyclic dependants).
Typically, we place declarations in header files which can then be included (via the #include compiler directive) in any source files that require them, thus ensuring all declarations are consistent. By organising declarations by their function we can include all related identifiers with a single #include directive. Declarations that are not actually used don't cost anything because declarations do not generate code. Definitions do generate code, but if the code is not used the only cost is in generating the code because unused code has neither internal or external linkages.
User Avatar

Wiki User

8y ago

What else can I help you with?

Continue Learning about Engineering

Explain the structure of c program with an suitable example?

Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...) Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...)


Define documentation section of a c program?

The different sections of a program are: 1. Heap 2. Stack 3.Data segments 4. Read only area 5. Code You can also look into google for more information http://en.wikipedia.org/wiki/Data_segment


What is the difference between define and undefine?

# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code. For example: # define HELLO 5 Creates an association between HELLO and replaces it with 5 in the code (for the compiler only). The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.


What are its program components?

the main() function,the#include Directive, the variable definition. function prototype, program statements, the function definition,program comments and braces are the components of program in C++


What is link section in c program?

the link section provides instruction to the compiler to the link function from the system library.

Related Questions

What are the different section in c sharp program?

Depends on the definition of Section and the context. C# itself has no such notion.


What is the user defined function section in C language?

There are no 'sections' in C source, you can define functions anywhere, except inside another function or variable/type definition.


Explain the structure of c program with an suitable example?

Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...) Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...)


Define documentation section of a c program?

The different sections of a program are: 1. Heap 2. Stack 3.Data segments 4. Read only area 5. Code You can also look into google for more information http://en.wikipedia.org/wiki/Data_segment


What is a basic structure of a c programming?

Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...) Basic structure of a C program is /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaretion section */ /* Function section */ (return type) (function name) (arguments...) void main() { Declaration part Executable part (statements) } /* Sub-program section */ (return type) (function name 1) (arguments...) (return type) (function name 2) (arguments...) . . . (return type) (function name n) (arguments...)


C program to find largest among three numbers?

#define max2(a,b) (b>a?b:a) #define max3(a,b,c) (max2(a,max(b,c)))


What is the difference between define and undefine?

# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code. For example: # define HELLO 5 Creates an association between HELLO and replaces it with 5 in the code (for the compiler only). The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.


What is difference between what and define?

# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code. For example: # define HELLO 5 Creates an association between HELLO and replaces it with 5 in the code (for the compiler only). The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.


What are its program components?

the main() function,the#include Directive, the variable definition. function prototype, program statements, the function definition,program comments and braces are the components of program in C++


How do you pass in Anna university chennai?

Define c-program and give an example


What is link section in c program?

the link section provides instruction to the compiler to the link function from the system library.


C programming language bsc it notes?

different between defining value definition section and defining value declaration section