// file: /data/courses/ece_1111/lectures/current/lecture_05/example.cc // // local include files // #include "example.h" // function: main // // This is a simple program that prints to the terminal. // int main(int argc, const char** argv) { unsigned int i = atoi(argv[1]); fprintf(stdout, "i = %f (%s)\n", i, argv[1]); // declare an unsigned char - one byte // float x; fprintf(stdout, "%fd: %f\n", x, x); unsigned char foo, goo, fsoso, j; //for (long i = 0; i < 257; i++) { //foo = i; //fprintf(stdout, "%d: %d\n", i, foo); // } // declare a signed character - ASCII // //char c; //for (long i = -128; i < 128; i++) { //c = i; //fprintf(stdout, "%d: %c (%d)\n", i, c, c); //} // declare a 16-bit integer // //short s; // unsigned short us; //for (long i = -32768; i < 32768; i++) { //s = i; //fprintf(stdout, "%d: %d (%d)\n", i, s, s); // } // declare an "int" integer // // int k; // unsigned int uk; // for (int i = -pow(2,31); i < pow(2,31); i++) { // k = i; // fprintf(stdout, "%d: %d (%d)\n", k, k, k); // } // declare long integer // // long l; // unsigned long ul; // for (long i = -2^63; i < 2^63 - 1; i++) { // s = i; // fprintf(stdout, "%d: %d (%d)\n", i, s, s); // } // declare a floating-point number // // float x = 27.00125; //fprintf(stdout, "x = %f\n", x); // declare a double precision floating-point number // // double y = 27.00125; //fprintf(stdout, "y = %f\n", y); // declare a character string // // char* joe = (char*)"Joe"; // fprintf(stdout, "joe = %s\n", joe); // declare a boolean value // // bool b = true; // bool bb = false; // exit gracefully // return(0); }