What do you mean by correct? It depends. Just compile and run it. 1. You should never use sizeof( in a loop condition. Create a variable and store the size in it.
2. To speed up execution, move non-dynamic arrays out to global scope (precache), make them constant.
3. Try to avoid magic numbers, use constants instead.