int main (int argc, char **argv) { (void) argc; // warning: unused parameter 'argc' execname = basename (argv[0]); // Declare the box and initialize it. intx *box = new_intx(); printf ("box = %p\n", box); // Perform a couple of operations on it. put_intx (box, 1024); printf ("box value is %d\n", get_intx (box)); // Free up the box and set the handle to NULL to avoid a dangle. free_intx (box); box = NULL; return EXIT_SUCCESS; }
int main (int argc, char **argv) { argc = argc; // Avoid:16: warning: unused parameter 'argc' execname = basename (argv[0]); say_when ("starting"); /* Declare the box and initialize it. */ intx_ref box = new_intx(); printf ("box = %p\n", box); /* Perform a couple of operations on it. */ put_intx (box, 1024); printf ("box value is %d\n", get_intx (box)); /* Free up the box and set the handle to NULL to avoid a dangle. */ free_intx (box); box = NULL; /* OK! */ say_when ("finished"); return EXIT_SUCCESS; }