+ 1
Are there ranges in C++?
I'm making a C++ code but I have a proble. Can you make ranges or something similar to that in C++?
2 Réponses
+ 4
I guess you can make your own ranges, a basic implementation would look like:
https://code.sololearn.com/cNefXGiolVj9/?ref=app
+ 3
If you are talking about Python's range objects, why don't you just use for loops?
In Python this corresponds:
for i in range(x, y, z): pass
this in C++:
for (int i = x, i < y; i += z) {}