How can I assign a div_t value i found using the div function (with 2 integers) to a integer? For example:
Wont work. How can i make it work? Thanks!Code:int r; div_t d; d = div(10, 3); r = d;
How can I assign a div_t value i found using the div function (with 2 integers) to a integer? For example:
Wont work. How can i make it work? Thanks!Code:int r; div_t d; d = div(10, 3); r = d;
http://www.cplusplus.com/ref/cstdlib/div.html
It depends... what is it that you want to do? Assign the int to the remainder, or to the quotient?
r = d.quot;
r = d.rem;
s/he will use them both since s/he know them both....
C++
The best
Ok, thank you it worked.