I am a beginner to c++, so I don't know much
here is a function
void example(){
for(int i=0; i<5; i++){
// do stuff
}
}
if I call this function, it will wait for it to be finished before continuing
int main(){
example();
otherThingsGoHere();
otherThingsGoHere();
otherThingsGoHere();
return 0;
}
the otherThingsGoHere() doesn't get called until example() is done
my goal is to have that function be able to loop 60/70 fps in a loop forever
and I did get it working, except nothing below that will happen since it is in an infinite loop.
I've been a c# developer for some time and I know that in c#, you can use async functions to run on a seperate thread. How do I impliment something like this in c++?
Edit: I am not asking for you to put the otherThingsGoHere in front of the main because the other things is going to be another loop, so I need both of them to run at the same time