開発環境 |
Microsoft Visual C++ 2010 Express (SP1) |
実行環境 |
Microsoft Windows XP Home Edition (SP3) |
プロジェクトの種類 |
空の CLR プロジェクト |
プロジェクト名 |
syscon |
Beep メソッドは、Windows Vista と Windows XP の 64 ビット エディションではサポートされていません。
Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition プラットフォーム メモ:
これらのオペレーティング システムでは、frequency パラメーターおよび duration パラメーターは無視されます。
syscon1.cpp
using namespace System;
int main()
{
array<int> ^aScale = {3, 5, 7, 8, 10, 12, 14, 15}; // 音階
for (int i = 0; i < 3; i++) {
for each (int scale in aScale) {
double freq = 440.0 * Math::Pow(2.0, scale / 12.0);
Console::Beep((int)freq, 100 + 50 * i);
}
}
return 0;
}
最終更新:2012年09月26日 16:37