play music with c++

Hi, I'm a beginner in C + +. How to implement the following code start playing music in 2 seconds?
It would be better if you could give me a simple example source code.

1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <windows.h>
#include "MMSystem.h"
using namespace std;
int main()
{
	PlaySound(TEXT("music.wav"), NULL, SND_SYNC);	
	return 0;
}
Topic archived. No new replies allowed.