Thanks, guys. Especially Pterodactyl. I'm finally able to make it work.
By the way, I'm using Windows 7. It will be great if you guys can give me the source code for PlaySound function.
You don't need source code for the PlaySound function if you are on Windows - just add the following line to the top of your file and off you go: #include <Windows.h>