You didn't initialise sum, so you missed the first term in the series. You are also getting confused about the function argument (which should be e, not sum, in the function declaration). You should return sum as a double from the function (not have a return type of void) and print the answer in the main loop.
It would be better to calculate the terms by a multiplier of the previous one, not a new factorial every time.
Although you can use a for loop for n in this way, a while loop might be better in this instance.
You should re-read my reply to your previous post and follow it carefully. This would have been better as a continuation of that thread, not a new thread.