Application not responding,apphanging

Hi everybody im new here not new to C++ just catching up on it, Im writing alarm program, the program works and does the job, but hangs in the process heres the piece of the code causing the problem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
bool SetTime(int hour,int min)
{ 
  loop:
   time_t s=time(0);  
   tm t=*localtime(&s); 
   
   if( hour != t.tm_hour)
    {
         
          goto loop; 
           }
    if( min != t.tm_min)
    {
          
          goto loop; 
           }
           exit(0);
            
  
     }


Topic archived. No new replies allowed.