How many times have you been writing a program [even the smallest one] and fall into a mistake without noticing ?
how many times have you spend houres trying to figure out what the hell is wrong ?
me , i can't count how many times

so , here we are going to post our mistakes and solutions [even the stupidest one]
lets start
#include <stdio.h>
void terminate(int *pointer)
{
(*pointer) = 0;
}
int main(void)
{
int this_number = 1;
while(this_number && this_number != 0)
{
if(this_number > 5)
{
terminate(&this_number);
}
printf("%d\n", this_number);
this_number ++;
}
return 0;
}
have you figured out what's its suppose to do ?
yeah , it was supposed to terminate the while loops when {this_number} reaches a higher number than five
but it won't !
where is my mistake ?
you see , here is the problem about writing code without logically sorting your steps
you are using DWIM , its not working

the problem that the (terminate() functions is doing it's work) which is truncating the variable to ( 0 );
then you prints the number and increase it again !? that what makes it a forever loop
solution is easy , is that you put the increasing statement before the (terminate()) gets called
while(this_number && this_number != 0)
{
printf("%d\n", this_number);
this_number ++;
if(this_number > 5)
{
terminate(&this_number);
}
}