Virus.
A virus is a malicious program or script that Spreads.
Malware, however, will not spread.
Viruses can spread without a victim's permission because it is automated to do so.
For example, the Melissa virus would look like a file attachment that used reverse psychology to make you open it. From there, it goes through the first 50 email contacts stored on your computer and sends the virus to them from your computer.
Google c++ tutorial. Cplusplus and Tutorials Point both have some good resources