efilnikufecin
Member
keep in mind:
1> that this is a sample, and my_func may have an item parameter which is not shown.
2> int a, and b are true variables in that there values may be other than shown, or may be calculated on the fly beforehand.
3> 10 is a constant...in every example we divide a and b by 10, just different methods are used.
method 1
or
method 2
or
method 3
1> that this is a sample, and my_func may have an item parameter which is not shown.
2> int a, and b are true variables in that there values may be other than shown, or may be calculated on the fly beforehand.
3> 10 is a constant...in every example we divide a and b by 10, just different methods are used.
method 1
Code:
int a = 1000;
int b = 100;
my_func(a, a / 10);
my_func(a, a / 10);
my_func(a, a / 10);
my_func(a, a / 10);
my_func(b, b /10);
my_func(b, b /10);
my_func(b, b /10);
my_func(b, b /10);
or
method 2
Code:
int a = 1000;
int b = 100;
int c = a / 10;
int d = b / 10;
my_func(a, c);
my_func(a, c);
my_func(a, c);
my_func(a, c);
my_func(b, d);
my_func(b, d);
my_func(b, d);
my_func(b, d);
or
method 3
Code:
int a = 1000;
int b = 100;
int c = 10;
my_func(a, a / c);
my_func(a, a / c);
my_func(a, a / c);
my_func(a, a / c);
my_func(b, b / c);
my_func(b, b / c);
my_func(b, b / c);
my_func(b, b / c);