Пример #1
0
int main(int argc, const char *argv[])
{
	log_info("My name: %s, age: %d",MY_NAME,get_age());
	set_age(24);
	log_info("My age is now: %d",get_age());

	log_info("The Size is: %d",THE_SIZE);
	print_size();

	THE_SIZE=9;
	log_info("The Size is now: %d",THE_SIZE);
	print_size();

	log_info("Ratio at first: %f",update_ratio(2.0));
	log_info("Ratio again: %f",update_ratio(10.0));
	log_info("Ratio once more: %f",update_ratio(300.0));

	int count=4;
	scope_demo(count);
	scope_demo(count*20);

	log_info("Count after calling scope_demo: %d",count);
	return 0;

	return 0;
}
Пример #2
0
int main(int argc, char *argv[])
{
    // test out THE_AGE accessors
    log_info("My name: %s, age: %d", MY_NAME, get_age());

    set_age(100);

    log_info("My age is now: %d", get_age());

    // test out THE_SIZE extern
    log_info("THE_SIZE is: %d", THE_SIZE);
    print_size();

    THE_SIZE = 9;

    log_info("THE_SIZE is now: %d", THE_SIZE);
    print_size();

    //test the ratio function static
    log_info("Ratio at first: %f", update_ratio(2.0));
    log_info("Ratio again: %f", update_ratio(10.0));
    log_info("Ratio once more: %f", update_ratio(300.0));

    // test the scope demo
    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("count after calling scope_demo: %d", count);

    return 0;
}
Пример #3
0
int main(int argc, char *argv[])
{
	log_info("My name: %s, age: %d", MY_NAME, get_age());

	set_age(100);

	log_info("My age is now: %d", get_age());

	log_info("THE_SIZE is; %d", THE_SIZE);
	print_size();

	THE_SIZE = 9;

	log_info("THE SIZE is now: %d", THE_SIZE);
	print_size();

	log_info("Ratio at first: %f", update_ratio(2.0));
	log_info("Ratio again: %f", update_ratio(10.0));
	log_info("Ratio once more: %f", update_ratio(300.0));

	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);
	
	log_info("count after calling scope_demo: %d", count);
	
	log_info("The value of ratio is : %f", *RATIO_PTR);

	test_func();
	log_info("The value of x outside test_func is : %d", *xptr);
	scope_demo(14);
	log_info("The value of x outside test_func is : %d", *xptr);

	return 0;
}
Пример #4
0
int main(int argc, char **argv) {
  log_info("My name is %s, age is %d", MY_NAME, get_age());

  set_age(100);

  log_info("My age is now %d", get_age());

  log_info("THE SIZE is %d", THE_SIZE);
  print_size();

  THE_SIZE = 9;

  log_info("THE SIZE is now %d", THE_SIZE);
  print_size();

  log_info("Ratio at first: %f", update_ratio(2.0));
  log_info("Ratio again: %f", update_ratio(10.0));
  log_info("Ratio once more: %f", update_ratio(300.0));

  int count = 4;
  scope_demo(count);
  scope_demo(count * 20);

  log_info("count after calling scope demo %d", count);

  return 0;
}
Пример #5
0
int main(int argc, char *argv[])
{
	log_info("my name: %s, age: %d", MY_NAME, get_age());

	set_age(100);

	log_info("my age is now: %d", get_age());

	// test ou thte SIZE_EXTERN
	log_info("THE_SIZE is: %d", THE_SIZE);
	print_size();

	log_info("Ratio at first: %f", *update_ratio(2.0));
	log_info("Ratio again: %f", *update_ratio(10));
	log_info("Ratio once more: %f", *update_ratio(300.0));

	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);

	log_info("count after calling scope_demo: %d", count);

	double *static_ratio = update_ratio(0.5);
	log_info("reaching in to the static ratio: %f", *static_ratio);

	*static_ratio = .001;
	
	log_info("changed the static ration in to the static ratio: %f", *static_ratio);

	return 0;
}
Пример #6
0
int main()
{
	log_info("My name : %s, age: %d",MY_NAME,get_age());
	
	set_age(100);
	
	log_info("My name now is : %d",get_age());
	
	log_info("THE_SIZE is: %d", THE_SIZE);
	
	print_size();
	
	THE_SIZE = 9;

    log_info("THE SIZE is now: %d", THE_SIZE);
    print_size();
    
    log_info("Ratio at first: %f", update_ratio(2.0));
    log_info("Ratio again: %f", update_ratio(10.0));
    log_info("Ratio once more: %f", update_ratio(300.0));
    
    // test the scope demo
    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("count after calling scope_demo: %d", count);
    
	return 0;
}
Пример #7
0
int main(int argc, char *argv[])
{
    log_info("my name %s, age %d", MY_NAME, get_age());

    set_age(100);

    log_info("my age is now %d", get_age());
    log_info("THE_SIZE is %d", THE_SIZE);
    print_size();

    THE_SIZE = 9;

    log_info("THE_SIZE is now %d ", THE_SIZE);
    print_size();

    log_info("ratio at first : %f", update_ratio(2.0));
    log_info("ratio now : %f", update_ratio(10.0));
    log_info("ratio finally : %f", update_ratio(300.0));

    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("Count after calling scope_demo : %d", count);

    return 0;
}
Пример #8
0
int main(int argc, char *argv[])
{
    // test out THE_AGE accessors
    log_info("My name: %s, age: %d", MY_NAME, get_age());

    set_age(100);

    log_info("My age is now: %d", get_age());

    int new_age = 44;
    log_info("Setting age directly to %d", new_age);
    int *age = get_age_pointer();
    *age = new_age;

    log_info("My age is now: %d", get_age());

    // test out THE_SIZE extern
    log_info("THE_SIZE is: %d", THE_SIZE);
    print_size();

    THE_SIZE = 9;

    log_info("THE_SIZE is now: %d", THE_SIZE);
    print_size();

    // test the ratio function static
    log_info("Ratio at first: %f", update_ratio(2.0));
    log_info("Ratio again: %f", update_ratio(10.0));
    log_info("Ratio once more: %f", update_ratio(300.0));

    // accessing a function static
    double *func_static_value = get_function_static(4.0);
    log_info("get_function_static(4.0) = %.1f", *func_static_value);
    double new_func_static_value = 8.0;
    log_info("Setting the function static var directly to %.1f",
            new_func_static_value);
    *func_static_value = new_func_static_value;
    log_info("get_function_static(4.0) = %.1f", *get_function_static(4.0));

    // test the scope demo
    int count = 4;
    scope_demo(count);
    scope_demo(count * 20);

    log_info("count after calling scope_demo: %d", count);

    return 0;
}
Пример #9
0
int main(int argc, char *argv[])
{
	// test out THE_AGE accessors
	log_info("My names: %s, age: %d", MY_NAME, get_age());

	set_age(100);

	log_info("My age is now: %d", get_age());

	// test out THE_SIZE extern
	log_info("THE_SIZE is: %d", THE_SIZE);
	print_size();

	THE_SIZE = 9;

	log_info("THE_SIZE is now: %d", THE_SIZE);
	print_size();

	// test the ration function static
	log_info("Ratio at first: %f", update_ratio(2.0));
	log_info("Ratio again: %f", update_ratio(10.0));
	log_info("Ratio once more: %f", update_ratio(300.0));

	double *res = update_ratio_ptr(2.0);
	log_info("Ratio by pointer: %f\n", *res);
	*res = 100.0;
	res = update_ratio_ptr(15.0);
	log_info("Ratio by pointer: %f\n", *res);

	// test the scope demo
	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);

	log_info("count after calling scope_demo: %d", count);

	log_info("Recursive result: %llu\n", recursive(100000, 0));

	return 0;
}
Пример #10
0
int main(int argc, char** argv) {
        log_info("My name is %s and I am %d years old.", MY_NAME, get_age());

        set_age(100);

        log_info("Now I'm older! I'm %d.", get_age());

        log_info("The size is: %d", THE_SIZE);
        print_size();

        THE_SIZE = 9;

        log_info("The size is now: %d", THE_SIZE);
        print_size();

        // test the ratio function static
        log_info("Ratio: %f", *update_ratio(2.0));
        log_info("Ratio: %f", *update_ratio(10.0));
        log_info("Ratio: %f", *update_ratio(300.0));

        double* evil = update_ratio(1.0);

        // H4X. I grabbed a static function variable and am changing its
        // contents here.
        log_info("%f", *evil);
        *evil = 123.0;
        log_info("%f", *evil);
        update_ratio(9);

        // test the scope demo
        int count = 4;
        scope_demo(count);
        scope_demo(count * 20);

        log_info("count after calling scope_demo: %d", count);

        return 0;
}
Пример #11
0
int main(int argc, char *argv[])
{
	// test out THE_AGE accessors
	log_info("My name: %s, age: %d", MY_NAME, get_age());
	set_age(200);
	log_info("My age is now: %d", get_age());
	// test out THE_SIZE extern
	log_info("THE_SIZE is: %d", THE_SIZE);
	log_info("The address of THE_SIZE is: %p", &THE_SIZE);
	print_size();

	THE_SIZE = 9;

	log_info("The SIZE is now: %d", THE_SIZE);
	print_size();

	// test the ratio function static
	log_info("Ratio at first: %f", update_ratio(2.0));
	log_info("Ratio again: %f", update_ratio(10.0));
	log_info("Ratio once more: %f", update_ratio(300.0));

	// test the scope demo
	int count = 4;
	scope_demo(count);
	scope_demo(count * 20);
/*	
	log_info("count after calling scope_demo: %d", count);
	log_info("The ratio is: %f", ratio);

	log_info("The address of THE_AGE: %p", &get_age());
	log_info("The current value of THE_AGE: %d", get_age());
	*get_age() = 0;
	log_info("After setting THE_AGE pointer to 0 THE_AGE value is: %d", THE_AGE);	
*/
	return 0;
}
Пример #12
0
static void
invert_ratio_changed_cb (GtkSpinButton     *spin,
			 GthFileToolResize *self)
{
	update_ratio (spin, self, TRUE);
}
Пример #13
0
static void
ratio_value_changed_cb (GtkSpinButton     *spin,
			GthFileToolResize *self)
{
	update_ratio (spin, self, FALSE);
}