19 points | by cremno 3 days ago
4 comments
while (i --> 0) { // use array[i] }
while (i-- != 0) { ... }
while (i--) { ... }
https://stackoverflow.com/questions/1642028/what-is-the-oper...
(Hi Ken!)
const size_t n = 10; for (size_t i = n; i --> 0;) { std::cout << i << "\n"; }
http://maulingmonkey.com/brainfuck/
VHDL's array/vector syntax actually works a similar way:
-- gives 0, 1, 2, 3:
for i in 0 to 3 loop
-- gives 3, 2, 1, 0:
for i in 3 downto 0 loop
-- Source - https://stackoverflow.com/a/7642026 -- Posted by Kerrek SB -- Retrieved 2026-10-29, License - CC BY-SA 3.0
https://stackoverflow.com/questions/1642028/what-is-the-oper...
(Hi Ken!)
http://maulingmonkey.com/brainfuck/
VHDL's array/vector syntax actually works a similar way:
-- gives 0, 1, 2, 3:
for i in 0 to 3 loop
-- gives 3, 2, 1, 0:
for i in 3 downto 0 loop
-- Source - https://stackoverflow.com/a/7642026 -- Posted by Kerrek SB -- Retrieved 2026-10-29, License - CC BY-SA 3.0