Why is it that in a infinite while loop you must add a true but in a for loop you can leave it empty?
Is it just how C++ works or any reason?
IIRC, The standard specifically says that
for (;;) is a valid way to write an infinite loop. Otherwise it wouldn't make much sense (since the empty statement does not evaluate to anything).
The while statement has no exception to normal constraints, requiring a valid expression (not a statement) that can be resolved to a boolean value in parentheses.
The infinite loop thing is just a shortcut (less to type) found in the original language. No other reason.
Hope this helps.