
KỸ THUẬT LẬP TRÌNH HỆ CƠ ĐIỆN TỬ
Programming Engineering in Mechatronics
1
TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI
Giảng viên: TS. Nguyễn Thành Hùng
Đơn vị: Bộ môn Cơ điện tử, Viện Cơ khí
Hà Nội, 2020

2
Chapter II. Modular programming in C++
•Structured programming relies on top-down design.
•In C and C++ languages, the smallest structural unit having
independent functionality is called function.
•If functions or a group of functions belonging together are
put in a separate module (source file), modular
programming is realised.
•Structural programming also contributes to creating new
programs from achieved modules (components) by bottom-
up design.
•This chapter aims to introduce the modular and procedural
programming in C++.

3
Chapter II. Modular programming in C++
❖The basics of functions
❖How to use functions on a more professional level?
❖Namespaces and storage classes
❖Preprocessor directives of C++

4
Chapter II. Modular programming in C++
❖The basics of functions
❖How to use functions on a more professional level?
❖Namespaces and storage classes
❖Preprocessor directives of C++

5
The basics of functions
❖Defining, calling and declaring functions
❖The return value of functions
❖Parametrizing functions
❖Programming with functions

