summaryrefslogtreecommitdiff
path: root/2005/flow-accounting-ols2005/OLS2005/EXAMPLE/complexCode/example-c.tex
blob: 2f8bf0d9f516ed8ced486f01b50b4cb0bafe18b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\begin{cprog}
typedef struct QuadTree {
  double Data;
  struct QuadTree 
     *Children[4];
} QT;

void Sum3rdChildren(QT *T,
           double *Result) {
  double Ret;
  if (T == 0) { Ret = 0;
  } else {
    QT *Child3 =
      T[0].Children[3];
    double V;
    Sum3rdChildren(Child3, 
                   &V);
    Ret = V + T[0].Data;
  }
  *Result = Ret;
}
\end{cprog} 
personal git repositories of Harald Welte. Your mileage may vary