Firstly, you should use a debugger to fix this. It will show you quickly exactly what the problem is. If you do not have one with your compiler then get one that does. Visual Studio 2017 community edition is available at no cost ie., free.
My guess is the fault is caused because t is invalid and you are deferencing an invalid pointer.
Try adjusting your loop so you display things in every iteration :
for( i = 0; i < n; ++i ) {
printf( "i is %d, count is %d\n", i, count );
showoff();
count++;
}