//Call monitor and run threads using a temp data structure (writing) void *threadWrite(void * bar){ int k; tData * foo = (tData *)bar; //Cast to new struct int iter; for(iter=0; iter<10;iter++) { ReadWrite.startWriting(); ReadWrite.fileWrite(timeS, timeMS, foo-> tID); for(k=0; k< (foo->tDelay);k++){} } delete foo; }