Submitted by tushar pramanick on Mon, 02/25/2013 - 11:35

Questions and Answers


Q Why do you need to put comments into your programs?
A Comments help us document what a program, or a special portion of a program, does. Especially when a program becomes very complex, we need to write comments to mark different parts in the program.

 

Q Why is the main() function needed in your program?
A The execution of a C program starts and ends with the main() function. Without the main() function, the computer does not know where to start to run a program.

 

Q What does the #include directive do?
A The #include directive is used to include header files that contain the declarations to the functions used in your C program. In other words, the #include directive tells the C preprocessor to look into directories and find the specified header file.

 

Q Why do you need a linker?
A After compiling, some function code may still be missing in the object file of a program. A linker must then be used to link the object file to the C standard library or other user-generated libraries and include the missing function code so that an executable file can be created.

 

 

Related Items

The Basics of Disk File I/O

The Basics of Disk File I/O

Now let's focus on how to open and close a disk data file and how to interpret error messages returned by I/O functions.

Files Versus Streams

Files Versus Streams

Exercises : Answer the following Question

To help solidify your understanding of this hour's lesson, you are encouraged to answer the quiz questions and finish the exercises provided in the Workshop before you move to the next lesson.

Question and Answer

    Q What are the differences between a union and a structure?

Making Structures Flexible

Making Structures Flexible

The second application of unions is to nest a union inside a structure so that the structure can hold different types of values.