Structured and object-oriented programming (OOP) in C++

Java is a pure object-oriented programming language, meaning that everything is an object except for a few primitive types. On the other hand, since C++ grew from C which is a structured programming language so it is a hybrid and C++ code can be either structured, object-oriented, or a mixture. If you are only familiar with Java, then you might wonder about structured programming, but even in Java, you could write a structured-like program that doesn't use objects. Suppose you only had the class that main is in. And you write functions to manipulate the data in that class. That is similar to structured programming. In structured programming, you have data and you write functions to process the data. The outline of a small structured program looks like
   your program comments
   any preprocessor directives, e.g., #include
   any global definitions, e.g., const, type definitions
   function prototypes
   int main() {
      locals for main
      body of main
      return 0;          // 0 for normal return
   function implementations
A simple example shows using the bubble sort on a textfile of student data: the bubble sort .cpp file

When you have a larger program, code is put into different files and #includes are used to make one large program.