// 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) { // grab a value from the command line // unsigned char sval = atoi(argv[1]); fprintf(stdout, "sval = %ld (%s)\n", sval, argv[1]); for (long i = 0; i < 260; i++) { sval = i; fprintf(stdout, "%d: %d\n", i, sval); } /* // 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); }