+ 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++?

2nd Oct 2019, 9:13 AM
RedTheAngryBird #1
RedTheAngryBird #1 - avatar
2 odpowiedzi
+ 4
I guess you can make your own ranges, a basic implementation would look like: https://code.sololearn.com/cNefXGiolVj9/?ref=app
2nd Oct 2019, 12:39 PM
Dennis
Dennis - avatar
+ 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) {}
2nd Oct 2019, 9:19 AM
Seb TheS
Seb TheS - avatar