// CSE 333 Su12 Lecture 10 demo: styleguide.cc // Gribble/Perkins // Good usage of const, reference, and pointer parameters. // Const references for "input" parameters read by a function; // pointers for "output" parameters set by a function. #include #include void CalcArea(const int &width, const int &height, int *area) { *area = width * height; } int main(int argc, char **argv) { int w = 10, h = 20, a; CalcArea(w, h, &a); return EXIT_SUCCESS; }