3 ms·
> only one finger on your "out" hand I think Python's way isn't amazing, but it's not too bad either: d, r = divmod(100, 3) It's a bit uglier in C++, but
by xscott 7y ago
> only one finger on your "out" hand
I think Python's way isn't amazing, but it's not too bad either:
d, r = divmod(100, 3)
It's a bit uglier in C++, but you could make this work:
int d, r;
refs(d, r) = divmod(100, 3);
I'm certain there's either a Boost or STL library for this. (I wrote my own for C++98 at one point)
It's clear you like stack based languages, and I certainly admit they can be concise.