I’m trying to make an alarm clock in which you can set multiple times. Here’s the code
std::cout<<"Enter the link: ";
std::string link;
std::cin>>link;
std::cout<<"\n\nProccessing...";
loop3: //Keep getting the time until everything adds up...
time_t s=time(0); //Getting ready for time
tm t=*localtime(&s); //Getting time put into Variable t
for(int i=0;i<n;i++){
if (hour[i] != t.tm_hour){
goto loop3;
}
if (min[i] != t.tm_min){
goto loop3;
}
ShellExecute(NULL, "open", link.c_str(), NULL, NULL, SW_SHOWNORMAL);
}
I want that it would open exactly amount of times as input in n, but as I understand as he executes the ShellExecute command it goes back to the start of the loop, checks the time and the time is still the same so he executes the command again. That way it get’s something similar to an endless loop for that exact minute.
So, is there a way to fix this? That the moment he executes the command he would only it once and then move along? I hope you’ll understand my explanation.
Do you want to do it in that way?