Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
C++
/
C fundamentals
What may portable C conclude about int next = index++ + index;?
from C fundamentals
C23 (GCC 13.3.0)
intermediate
3 min
What may portable C conclude about int next = index++ + index;?
It has undefined behavior because the modification and other read of index are unsequenced.
It always uses the old index value twice.
It always increments index before the second operand.
The result is implementation-defined and documented by the compiler.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in the balance comparison
Spot the bug
A new version is available
Reload