OOPortal
J2EEOnline RationalDB
prev next prev next
Course navigation
Lesson 5 Differences in C and C++ program structure
Objective Program Structure Differences between C and C++.
While there are some similarities between the structure of C and C++ programs, there are also some crucial differences.
  1. C++ relies on an external standard library to provide assertion testing. The information the program needs to use this library resides in the library file assert.h. The assert macro tests a condition for correctness and terminates the program if the test fails.
  2. A C++ program consists of declarations that may be in different files. Each function is on the external, or global, level and may not be declared in a nested manner. The files act as modules and may be separately compiled. We will be discussing scope and storage classes in greater detail later in this course.
Course navigation