開啟貝殼檔
將Do Re Mi.wav存至程式碼鎖在的資料夾
將build option//linker 裡Add winmm
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
PlaySoundA("Do.wav",NULL,SND_SYNC);
PlaySoundA("Re.wav",NULL,SND_SYNC);
PlaySoundA("Mi.wav",NULL,SND_SYNC);
return 0;
}
沒有留言:
張貼留言