WordPad probably saves your source file as an
RTF (Rich Text Format) document instead of a plain text file. The compiler ofcourse won't be able to parse your source file if it's saved as RTF.
Use something else - there are lots of good programmer's text editors available. I use Notepad++ sometimes, it's a popular and free text editor with syntax highlighting and other handy features. Or use an
IDE such as NetBeans or Eclipse.