Snippet. Vala. Traverse Array

Traversing an Array in Vala is extremely easy. This snippet shows you how.

int[] source = {1,2,3,4,5,6,7,8,9};
	    
for (int i=0; i< source.length; i++) {
    stdout.printf(source[i].to_string()+"\n");
}

Example


Updated on: 02 Dec 2024