<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>output stream &#187; C++</title>
	<atom:link href="http://duncanandmeg.org/blogs/code/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://duncanandmeg.org/blogs/code</link>
	<description>riotous events in amateur development</description>
	<lastBuildDate>Fri, 18 Feb 2011 21:28:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Birthday surprise</title>
		<link>http://duncanandmeg.org/blogs/code/2009/03/03/birthday-surprise/</link>
		<comments>http://duncanandmeg.org/blogs/code/2009/03/03/birthday-surprise/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 19:00:22 +0000</pubDate>
		<dc:creator>dtjohnso</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://duncanandmeg.org/blogs/code/?p=64</guid>
		<description><![CDATA[My wife and I wrote this little program for my little brother, who is a freshman computer science major. It was a lot of fun, and brought back memories of my C++ days in school. Obviously the programming wasn&#8217;t challenging, but getting the parameters right was a lot of fun. #include &#38;lt;iostream&#38;gt; #include &#38;lt;windows.h&#38;gt; #define [...]]]></description>
			<content:encoded><![CDATA[<p>My wife and I wrote this little program for my little brother, who is a freshman computer science major. It was a lot of fun, and brought back memories of my C++ days in school.</p>
<p>Obviously the programming wasn&#8217;t challenging, but getting the parameters right was a lot of fun.</p>
<pre><code class=\'prettyprint\'  class="prettyprint">#include &amp;lt;iostream&amp;gt;
#include &amp;lt;windows.h&amp;gt;

#define doo 262 //frequency do 262 Hz
#define re 294 //frequency re 294 Hz
#define mi 330 //frequency mi 330 Hz
#define fa 349 //frequency fa 349 Hz
#define sol 392 //frequency sol 392 Hz
#define la 440 //frequency la 440 Hz
#define si 495 //frequency si 495 Hz
#define od 523 //frequency do 523 Hz

using namespace std;

int main()
{  

  Beep(doo,100);
  Beep(doo,100);
  Beep(re,180);
  Beep(doo,190);
  Beep(fa,200);
  Beep(mi,300);
  Beep(doo,100);
  Beep(doo,100);
  Beep(re,180);
  Beep(doo,190);
  Beep(sol,220);
  Beep(fa,300);
  Beep(doo,100);
  Beep(doo,100);
  Beep(od,260);
  Beep(la,260);
  Beep(fa,220);
  Beep(mi,200);
  Beep(re,300);
  Beep(466,100); //b-flat is 2^(1/12)*440 http://en.wikipedia.org/wiki/Note#Note_frequency_.28hertz.29
  Beep(466,100); //b-flat is 2^(1/12)*440 http://en.wikipedia.org/wiki/Note#Note_frequency_.28hertz.29
  Beep(la,260);
  Beep(fa,300);
  Beep(sol,300);
  Beep(fa,300);

  return 1;
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://duncanandmeg.org/blogs/code/2009/03/03/birthday-surprise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

