solved a c for loop counter init error