Executing "past" a never-ending function isn't possible (if it doesn't end, you can't move past it). I am assuming that you want to have some code running in a loop in the background while your program does something else.
You want something like this:
#include <pthread.h>
int endLoop;
void* backgroundLoop(void* arg) {
while (!endLoop) {
...
}
return NULL;
}
int main (int argc, char** argv) {
pthread_t thread;
int retval;
...
// Launch background thread
endLoop = 0;
retval = pthread_create(&thread, NULL, backgroundLoop, NULL);
// Continue with main function
...
// Force background loop to end
endLoop = 1;
}
If you are using pthreads, you can find more info here. If you are using some other thread library, the concept will be similar but the thread create/destroy functions may look different.