ok, i think i made a tiny serial port reading program. now, i need to send each byte out to it's own text file, so would that be taking place within the "Main" thread? i know i can use the fstream library to output to a file (that's the only way i know, so don't yell at me if there's better ways). if that's the case, then should i also make the array and that stuff a variable that's passed in, so it can be passed to other functions? i don't really understand how threads work together, so i'm a bit confused on how the variable can go from the Read function to the main thread.
if someone could explain this to me, preferably tonight, cause i have access to the robot tomorrow, i'd be grateful, cause i want to test out my little program

. thanks in advance.