Chapter 6

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Why is the #ifndef preprocessor directive commonly used in modular program header files?

#ifndef make sure that all variables and function prototypes are pre-processed only once (no redeclaration of already declare functions).

List the advantages of using functions in a C program

1. A function is written once and compiled into one area of memory, so program memory is reduced. 2. Functions allow clean and manageable code to be designed. 3. The use of functions enables modular coding (group coding).

What are the limitations associated with using functions in a C program

1. Small execution time overhead in storing program position data 2. 'nesting' functions making programs hard to follow 3. Only a single value can be returned from the function and arrays of data cannot be passed to or from a function.

What is the purpose of the preprocessor in the C program compilation process?

A preprocessor looks at a particular source file and implements any directives and associated header files.

What is pseudocode and how is it useful at the software design stage?

A pseudocode consists of short, english phrases used to explain specific tasks within a program. It's useful at software design because it saves time for later coding stages and helps communicate with different designers and project managers.

At what stage in the program compilation process are predefined library files implemented?

Predefined libraries are implemented in the link stage.

What is a function 'prototype' and where can it be found in a C program?

Prototypes are the declaration statements for functions and they are found at the start of a program.

How much data can be input to and output from a function?

There are no restrictions on input/argument passed to a function. But only one output/argument can be returned from a function.

When would it be necessary to use the extern storage class specifier in an mbed C program?

When a mbed object is defined for global use and needed to be manipulated in other source files, the extern storage class specifier is then needed.


Ensembles d'études connexes

NCLEX CHAPTER 40 - Cardiovascular Disorders

View Set

Biology Final Exam Practice Questions

View Set

genetics and evolution exam 3 review

View Set

Assessment and Management of Patients With Eye and Vision Disorders

View Set