A
A
Arthur2016-09-21 16:50:27
C++ / C#
Arthur, 2016-09-21 16:50:27

What is the result of the expression "x-1", /* { int x=1; x-1} */ true or false?

I came across this code with a cycle:
int x=3;
for (int i; x-1; i++) {;}
I thought it would work twice but, for some reason, I can't fall out of it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2016-09-21
@Carver182

It will subtract endlessly from "3" "1" in a loop

A
Arthur, 2016-09-21
@Carver182

Everything is clear, thank you all, it was necessary to decrement

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question