GNU C “Nested Functions” Extension and Trampoline

Required background knowledge: activation record, static scoping & dynamic scoping.

Below is not standard C code. (case1)

foo (double a, double b){
  double square (double z) { return z * z; }    
  return square (a) + square (b);
}

Read more

Linux Process Programming – fork()

What is a process?

In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

Read more

An example of C++ dot vs. arrow usage

vs. Overall, dot(.) is for object itself, arrow(->) is for pointer. A good example worth a thousand words. The following example should be a good one. #include <iostream>   using namespace std;   class Car { public: int number;   void Create() { cout << "Car created, number is: " << number << "\n" ; … Read more