The problem with your code is twofold.
First of all, when you initialize your map_test array, you need to use the right syntax and must not include the name of the fields, but assign them in the correct order.
Second, in your loop, you should check if the loop variable is less than the number of elements in the map_test array as your code right now only checks if there is any element in the array.
#include <stdio.h>
typedef struct map_s
{
int ii;
int pi;
} map_t;
static map_t map_test[] = { { 10, 0 }, { 20, 0 } };
int main()
{
int i, j = 10;
while (j != 0) {
for (i = 0; i < sizeof(map_test)/sizeof(*map_test); i++) {
map_test[i].pi++;
}
j--;
}
for (i = 0; i < sizeof (map_test)/sizeof(*map_test); i++) {
printf("i %d, pi %d\n", map_test[i].ii, map_test[i].pi);
}
return 0;
}