4 questions
4
votes
1
answer
141
views
Check if array is a VLA at compile-time
@Lundin shows how to check if a passed expression is an array at compile-time here: Lvalue conversion of _Generic controlling expression involving array clang warning wrong?:
#define IS_ARRAY(T) ...
-1
votes
2
answers
175
views
If Scala is a compiled language, then why didn't it detect an out of bound exception in this program beforehand?
The program is:
object Hello extends App {
val a: List[Int] = List(1, 3, 4, 5, 8, 10, 11, 22, 33)
for (i <- 0 to 11)
println(a(i))
}
The Output is:
1
3
4
5
8
10
11
22
33
java....