I assume you are using Windows. With your knowledge in basic you should look into BCX. It programs in a modern basic and then translates to compile with a number of C or C++ compilers. I look at C is just a subset of C++, well let's say 99% of it is.
BCX comes with a fair number of sound examples. Look over the generated C code to get an understanding of the API calls it makes.
You can download the whole system for free from:
http://www.rjpcomputing.com/programm.../devsuite.html
I have used BCX to learn the finer points of C and C++ myself for quite a while, and recommend it as a learning tool!
For simple sounds on the internal speaker use a Windows API call to Beep(), the code below should work with most any C++ compiler. I tested it with the Dev C++ IDE that uses the very generic GNU compiler G++.
[php]// simple sounds via Beep(frequency_hrz, duration_ms)
#include <iostream>
#include <windows.h> // WinApi header
using namespace std;
int main()
{
Beep(523,500); // 523 hertz (C5) for 500 milliseconds
Beep(587,500);
Beep(659,500);
Beep(698,500);
Beep(784,500);
cin.get(); // wait
return 0;
}
[/php]