CodeQL library for C/C++
Search

Member predicate ForStmt::getInitialization

Gets the initialization statement of this ‘for’ statement.

For example, for

for (i = 0; i < 10; i++) { j++; }

the result is i = 0;.

Does not hold if the initialization statement is an empty statement, as in

for (; i < 10; i++) { j++ }
Stmt getInitialization()