>what does the "\n" do in oppose to endl; ?
endl forces the stream to be flushed, which means that the characters will be written immediately. "\n" doesn't flush the stream, so it's possible that if something happens to interrupt the program between the time you write the characters and the time the stream is flushed, you'll lose the output.
Generally you don't have to worry about using endl because the stream will be flushed at reasonable times for cout, or you should be using cerr for unbuffered output.
>when do you use void main instead of int main at the beginning of the program?
Never. Anyone who does it is wrong.