单项选择题

I forgot ______ a letter to him, so I wrote to him just now.

A.writing
B.having wrote
C.to have written
D.to write