// file: lecture_09/example.cc // // local include files // #include "example.h" // method: main // // main program starts here // int main(int argc, char** argv) { /* // order of operations // float x1 = 27.0; long x2 = 3; char c = 'a'; float sum = x1 + (float)x2 + (float)c; fprintf(stdout, "sum (%f) = %f + %d + %c (%d)\n", sum, x1, x2, c, c); // mixed expresssions // sum = x1 * ((float)x2 + (float)c); fprintf(stdout, "sum (%f) = %f * %d + %c (%d)\n", sum, x1, x2, c, c); // function calls // float sum = mysum(1.0, (float)2.0); float sum2 = pow(2.0, 3.0); fprintf(stdout, "%s: my sum = %f\n", argv[0], sum); */ if ((long)mysum((float)1.0, (float)1.252525) == (long)2.252525) { fprintf(stdout, "hello joe\n"); } if ((long)my_truncate(1.252525) == long(1)) { fprintf(stdout, "hello joe2\n"); } // exit gracefully // return(0); }