
△ABC
= ADEC - △ADB - △BEC
= 1/2(x1y2 + x2y3 + x3y1 - x2y1 - x3y2 - x1y3)
=

2. Heron's Formula
△= sqrt(s(s-a)(s-b)(s-c))
x = 1/2 (a+b+c)
Ref.:
http://en.wikipedia.org/wiki/Triangle
http://euler.tn.edu.tw/area.pdf
myvar = 25; foo = &myvar; bar = myvar;2. Dereference Operator (*)
baz = *foo;
#include <iostream> using namespace std; int main () { int numbers[5]; int * p; p = numbers; *p = 10; p++; *p = 20; p = &numbers[2]; *p = 30; p = numbers + 3; *p = 40; p = numbers; *(p+4) = 50; for (int n=0; n<5; n++) cout << numbers[n] << ", "; return 0;Output:
10, 20, 30, 40, 50,
int x; int * p1 = &x; // non-const pointer to non-const int const int * p2 = &x; // non-const pointer to const int int const * p3 = &x; // also non-const pointer to const int int * const p4 = &x; // const pointer to non-const int const int * const p5 = &x; // const pointer to const int
char a; char * b; char ** c; a = 'z'; b = &a; c = &b;
#include <iostream> using namespace std; int addition (int a, int b) { return (a+b); } int subtraction (int a, int b) { return (a-b); } int operation (int x, int y, int (*functocall)(int,int)) { int g; g = (*functocall)(x,y); return (g); } int main () { int m,n; int (*minus)(int,int) = subtraction; m = operation (7, 5, addition); n = operation (20, m, minus);Output:cout << n; return 0; }
8Mostly, we use function point in sqort().
(*p).foo; p->foo;