<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3950643458726157057</id><updated>2024-11-01T00:19:25.741-07:00</updated><category term="exercise"/><category term="tools"/><category term="Microsoft"/><category term="info"/><category term="embedded"/><category term="how to"/><category term="ref."/><category term="C++11"/><category term="news"/><title type='text'>C-exercise</title><subtitle type='html'>My exercise on C, C++, C++0x and C++11.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-4462720872820979429</id><published>2011-10-27T04:15:00.000-07:00</published><updated>2011-10-27T04:19:47.893-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Conditional operator (if operator)</title><content type='html'>conditional operator (also called &quot;if operator&quot;), if in the form of&lt;br /&gt;&lt;br /&gt;(&lt;span style=&quot;font-weight:bold;&quot;&gt;condition ? statements if condition is true : statements if condition is false&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;It&#39;s equal to:&lt;br /&gt;if(condition){&lt;br /&gt; statements if condition is true;&lt;br /&gt;}else{&lt;br /&gt; statements if condition is false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;conditional operator (if operator)&quot; &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; (true ? &quot;It&#39;s TRUE&quot; : &quot;It&#39;s FALSE&quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; (false ? &quot;It&#39;s TRUE&quot; : &quot;It&#39;s FALSE&quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;3 &amp;gt; 5: &quot; &amp;lt;&amp;lt; ((3 &amp;gt; 5) ? &quot;Yes&quot; : &quot;No&quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;&#39;Z&#39; &amp;gt; &#39;X&#39;: &quot; &amp;lt;&amp;lt; ((&#39;Z&#39; &amp;gt; &#39;X&#39;) ? &quot;Yes&quot; : &quot;No&quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYw62-goZI-ghFCv675-AhyphenhyphenThwf7veUmfa5JcBFKEPo6G9KvnEb1OmhKgLsruEKnG5nu_j9HFPYJ6l0zoL8vC1A2th0kx0Z-Biw7y4WuEsv8tOYw-aNna3UK4HLdWx7Z7aG5yGV2sPlt8/s1600/Conditional+operator+%2528if+operator%2529.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 202px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYw62-goZI-ghFCv675-AhyphenhyphenThwf7veUmfa5JcBFKEPo6G9KvnEb1OmhKgLsruEKnG5nu_j9HFPYJ6l0zoL8vC1A2th0kx0Z-Biw7y4WuEsv8tOYw-aNna3UK4HLdWx7Z7aG5yGV2sPlt8/s400/Conditional+operator+%2528if+operator%2529.png&quot; border=&quot;0&quot; alt=&quot;Conditional operator (if operator)&quot; title=&quot;Conditional operator (if operator)&quot; id=&quot;BLOGGER_PHOTO_ID_5668129322654854626&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/4462720872820979429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/conditional-operator-if-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/4462720872820979429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/4462720872820979429'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/conditional-operator-if-operator.html' title='Conditional operator (if operator)'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYw62-goZI-ghFCv675-AhyphenhyphenThwf7veUmfa5JcBFKEPo6G9KvnEb1OmhKgLsruEKnG5nu_j9HFPYJ6l0zoL8vC1A2th0kx0Z-Biw7y4WuEsv8tOYw-aNna3UK4HLdWx7Z7aG5yGV2sPlt8/s72-c/Conditional+operator+%2528if+operator%2529.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-3623117389144065457</id><published>2011-10-26T13:02:00.000-07:00</published><updated>2011-10-26T13:03:22.471-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="info"/><title type='text'>The C++/CX Episode</title><content type='html'>GoingNative 3: The C++/CX Episode with Marian Luparu&lt;br /&gt;&lt;iframe style=&quot;height:288px;width:512px&quot; src=&quot;http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-3-The-CCX-Episode-with-Marian-Luparu/player?w=512&amp;h=288&quot; frameBorder=&quot;0&quot; scrolling=&quot;no&quot; &gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/3623117389144065457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/ccx-episode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3623117389144065457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3623117389144065457'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/ccx-episode.html' title='The C++/CX Episode'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-7046982810601170477</id><published>2011-10-25T14:07:00.001-07:00</published><updated>2011-10-25T14:08:48.318-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Generate random number with srand()</title><content type='html'>In C/C++,  the &lt;b&gt;rand()&lt;/b&gt; function computes a sequence of pseudo-random integers in the range 0 to RAND_MAX. This function return a  pseudo-random integer, not true.&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;srand()&lt;/b&gt; function uses the argument as a seed for a new sequence of pseudo-random numbers to be returned by subsequent calls to rand(). If srand() is then called with the same seed value, the sequence of pseudo-random numbers shall be repeated. If rand() is called before any calls to srand have been made, the same sequence shall be generated as when srand() is ﬁrst called with a seed value of 1.&lt;br /&gt;&lt;br /&gt;In this exercise, current date and time, time(0), is used as seek for srand(). Such that the generated pseudo-random numbers will be a more random.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;   cout &amp;lt;&amp;lt; &quot;Random number generated by rand()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;   for(int i=0; i &amp;lt; 10; i++){&lt;br /&gt;       cout &amp;lt;&amp;lt; rand() % 100 &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;   }&lt;br /&gt;   cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;   cout &amp;lt;&amp;lt; &quot;Random number generated with srand()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;   srand(static_cast&amp;lt;unsigned int&amp;gt;(time(0)));&lt;br /&gt;   for(int i=0; i &amp;lt; 10; i++){&lt;br /&gt;       cout &amp;lt;&amp;lt; rand() % 100 &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;   }&lt;br /&gt;   cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikpaW799WxSXqgPxQCT5KHgqPBCP_BNOS57Wm-zZutBpu2gxGYZeivpeT-y5Be3PI-_yECYl3N5jgHsy1GraQRA0Zbe5XP0KUyPYBpdBWtjfQ8KC_56AaqC7Ybv3UrohzfR1Wc8YoN0Xo/s1600/random.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikpaW799WxSXqgPxQCT5KHgqPBCP_BNOS57Wm-zZutBpu2gxGYZeivpeT-y5Be3PI-_yECYl3N5jgHsy1GraQRA0Zbe5XP0KUyPYBpdBWtjfQ8KC_56AaqC7Ybv3UrohzfR1Wc8YoN0Xo/s400/random.png&quot; border=&quot;0&quot; alt=&quot;Generate random number with srand()&quot; title=&quot;Generate random number with srand()&quot; id=&quot;BLOGGER_PHOTO_ID_5667539467432720530&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/7046982810601170477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/generate-random-number-with-srand.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/7046982810601170477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/7046982810601170477'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/generate-random-number-with-srand.html' title='Generate random number with srand()'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikpaW799WxSXqgPxQCT5KHgqPBCP_BNOS57Wm-zZutBpu2gxGYZeivpeT-y5Be3PI-_yECYl3N5jgHsy1GraQRA0Zbe5XP0KUyPYBpdBWtjfQ8KC_56AaqC7Ybv3UrohzfR1Wc8YoN0Xo/s72-c/random.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-8698581189489738349</id><published>2011-10-21T14:29:00.000-07:00</published><updated>2011-10-21T14:34:54.508-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ref."/><title type='text'>Comparison of Java and C++</title><content type='html'>The differences between the C++ and Java programming languages can be traced to their heritage, as they have different design goals.&lt;ul&gt;&lt;li&gt;C++ was designed for systems and applications programming, extending the C programming language. To this procedural programming language designed for efficient execution, C++ has added support for statically-typed object-oriented programming, exception handling, scoped resource management, and generic programming, in particular. It also added a standard library which includes generic containers and algorithms.&lt;/li&gt;&lt;li&gt;Java was created initially as an interpreter for printing systems but grew to support network computing. Sun Microsystems used it for the basis of their &quot;HotJava&quot; thin client system. It relies on a virtual machine to be secure and highly portable. It is bundled with an extensive library designed to provide a complete abstraction of the underlying platform. Java is a statically-typed object-oriented language that uses a syntax similar to C++, but is not compatible with it. It was designed from scratch with the goal of being easy to use and accessible to a wider audience.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Wikipedia have a article, &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B&quot;&gt;&lt;b&gt;Comparison of Java and C++&lt;/b&gt;&lt;/a&gt;, it&#39;s list the difference in more details.&lt;br /&gt;&lt;br /&gt;It&#39;s a sample chapter of the book Java in a Nutshell, describe &lt;a href=&quot;http://oreilly.com/catalog/javanut/excerpt/index.html&quot;&gt;&lt;b&gt;How Java Differs from C&lt;/b&gt;&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/8698581189489738349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/comparison-of-java-and-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8698581189489738349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8698581189489738349'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/comparison-of-java-and-c.html' title='Comparison of Java and C++'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-4435873935362711953</id><published>2011-10-11T14:19:00.001-07:00</published><updated>2011-10-11T14:21:14.086-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Exercise of STL stack</title><content type='html'>&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;stack&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;STL stack exercise&quot; &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    stack&amp;lt;int&amp;gt; MyStack;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;init without anything&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt;&quot;MyStack.size(): &quot; &amp;lt;&amp;lt; MyStack.size() &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;push something in&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    MyStack.push(1);&lt;br /&gt;    MyStack.push(2);&lt;br /&gt;    MyStack.push(3);&lt;br /&gt;    MyStack.push(4);&lt;br /&gt;    cout &amp;lt;&amp;lt;&quot;MyStack.size(): &quot; &amp;lt;&amp;lt; MyStack.size() &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;pop all out&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    while (!MyStack.empty())&lt;br /&gt;    {&lt;br /&gt;        cout &amp;lt;&amp;lt; MyStack.top() &amp;lt;&amp;lt; endl;&lt;br /&gt;        MyStack.pop();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8lcVVJ9NaRTa2bVcFdQdc7M4I5zmDnKpZ93KEKNd3XF2L9Q6qe-E4Wa9kX_mibehPvhDFE8-xPzDMLCxWnp2PcdWVTWsnPZM3ZEBIURYCcdfQqZSDmyW04PIvIy0MlSEZPi9VoeS-vYI/s1600/STL+stack+exercise.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8lcVVJ9NaRTa2bVcFdQdc7M4I5zmDnKpZ93KEKNd3XF2L9Q6qe-E4Wa9kX_mibehPvhDFE8-xPzDMLCxWnp2PcdWVTWsnPZM3ZEBIURYCcdfQqZSDmyW04PIvIy0MlSEZPi9VoeS-vYI/s400/STL+stack+exercise.png&quot; border=&quot;0&quot; alt=&quot;Exercise of STL stack&quot; title=&quot;Exercise of STL stack&quot; id=&quot;BLOGGER_PHOTO_ID_5662347430446743122&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/4435873935362711953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/exercise-of-stl-stack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/4435873935362711953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/4435873935362711953'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/exercise-of-stl-stack.html' title='Exercise of STL stack'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8lcVVJ9NaRTa2bVcFdQdc7M4I5zmDnKpZ93KEKNd3XF2L9Q6qe-E4Wa9kX_mibehPvhDFE8-xPzDMLCxWnp2PcdWVTWsnPZM3ZEBIURYCcdfQqZSDmyW04PIvIy0MlSEZPi9VoeS-vYI/s72-c/STL+stack+exercise.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-262922269420347371</id><published>2011-10-08T12:09:00.001-07:00</published><updated>2011-10-08T12:10:48.236-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Doubly Linked List</title><content type='html'>&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class Node {&lt;br /&gt;    private:&lt;br /&gt;        Node();&lt;br /&gt;        Node(string s, Node* p, Node* n);&lt;br /&gt;        string body;&lt;br /&gt;        Node* prev;&lt;br /&gt;        Node* next;&lt;br /&gt;    friend class DoublyLinkedList;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Node::Node(){&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Node::Node(string s, Node* p, Node* n){&lt;br /&gt;    body = s;&lt;br /&gt;    prev = p;&lt;br /&gt;    next = n;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class DoublyLinkedList{&lt;br /&gt;    public:&lt;br /&gt;        DoublyLinkedList();&lt;br /&gt;        ~DoublyLinkedList();&lt;br /&gt;        void AddInFront(string s);&lt;br /&gt;        void RemoveInFront();&lt;br /&gt;        void AddInBack(string s);&lt;br /&gt;        void RemoveInBack();&lt;br /&gt;        void ShowAll();&lt;br /&gt;    private:&lt;br /&gt;        Node* head;&lt;br /&gt;        Node* trail;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;DoublyLinkedList::DoublyLinkedList(){&lt;br /&gt;    head = new Node();&lt;br /&gt;    trail = new Node();&lt;br /&gt;    head-&amp;gt;next = trail;&lt;br /&gt;    trail-&amp;gt;prev = head;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;DoublyLinkedList::~DoublyLinkedList(){&lt;br /&gt;    while (head-&amp;gt;next != trail){&lt;br /&gt;        RemoveInFront();&lt;br /&gt;    }&lt;br /&gt;    delete head;&lt;br /&gt;    delete trail;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void DoublyLinkedList::AddInFront(string s){&lt;br /&gt;    Node* nxFrontNode = head-&amp;gt;next;&lt;br /&gt;    Node* n = new Node(s, head, head-&amp;gt;next);&lt;br /&gt;    head-&amp;gt;next = n;&lt;br /&gt;    nxFrontNode-&amp;gt;prev = n;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void DoublyLinkedList::RemoveInFront(){&lt;br /&gt;    if(head-&amp;gt;next != trail){&lt;br /&gt;        Node* nxFrontNode = head-&amp;gt;next;&lt;br /&gt;        Node* nnxFrontNode = nxFrontNode-&amp;gt;next;&lt;br /&gt;        head-&amp;gt;next = nnxFrontNode;&lt;br /&gt;        nnxFrontNode-&amp;gt;prev = head;&lt;br /&gt;        delete nxFrontNode;&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void DoublyLinkedList::AddInBack(string s){&lt;br /&gt;    Node* nxBackNode = trail-&amp;gt;prev;&lt;br /&gt;    Node* n = new Node(s, trail-&amp;gt;prev, trail);&lt;br /&gt;    trail-&amp;gt;prev = n;&lt;br /&gt;    nxBackNode-&amp;gt;next = n;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void DoublyLinkedList::RemoveInBack(){&lt;br /&gt;    if(trail-&amp;gt;prev != head){&lt;br /&gt;        Node* nxBackNode = trail-&amp;gt;prev;&lt;br /&gt;        Node* nnxBackNode = nxBackNode-&amp;gt;prev;&lt;br /&gt;        trail-&amp;gt;prev = nnxBackNode;&lt;br /&gt;        nnxBackNode-&amp;gt;next = trail;&lt;br /&gt;        delete nxBackNode;&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void DoublyLinkedList::ShowAll(){&lt;br /&gt;    Node* n = head-&amp;gt;next;&lt;br /&gt;    while(n != trail){&lt;br /&gt;        cout &amp;lt;&amp;lt; n -&amp;gt; body &amp;lt;&amp;lt; endl;&lt;br /&gt;        n = n -&amp;gt; next;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;- Doubly Linked List exercise -&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Create a new DoublyLinkedList: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    DoublyLinkedList myDoublyLinkedList;&lt;br /&gt;    myDoublyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Remove nothing in a empty Doubly Linked List: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    myDoublyLinkedList.RemoveInFront();&lt;br /&gt;    myDoublyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Insert something in Front: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    myDoublyLinkedList.AddInFront(&quot;ABC&quot;);&lt;br /&gt;    myDoublyLinkedList.AddInFront(&quot;DEFGH&quot;);&lt;br /&gt;    myDoublyLinkedList.AddInFront(&quot;I&quot;);&lt;br /&gt;    myDoublyLinkedList.AddInFront(&quot;JK&quot;);&lt;br /&gt;    myDoublyLinkedList.AddInFront(&quot;LMN&quot;);&lt;br /&gt;    myDoublyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Remove something in Front: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    myDoublyLinkedList.RemoveInFront();&lt;br /&gt;    myDoublyLinkedList.RemoveInFront();&lt;br /&gt;    myDoublyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Insert something in Back: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    myDoublyLinkedList.AddInBack(&quot;RST&quot;);&lt;br /&gt;    myDoublyLinkedList.AddInBack(&quot;UVW&quot;);&lt;br /&gt;    myDoublyLinkedList.AddInBack(&quot;XYZ&quot;);&lt;br /&gt;    myDoublyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Remove something in Back: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    myDoublyLinkedList.RemoveInBack();&lt;br /&gt;    myDoublyLinkedList.RemoveInBack();&lt;br /&gt;    myDoublyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;end!&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDM4GR2OLiupOgxrXuxtVcTfbVHDZEKQcxSmw2hgFnes33-FnhxStKo6x4VU3pSy0CtqtLY8R8dVGL5zQMONkGgZetFSsr_OzkSalkH_uJYqs5jTSS3rNpcV0s3duwLtAVOp-kzdzOoi8/s1600/Doubly+Linked+List.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 397px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDM4GR2OLiupOgxrXuxtVcTfbVHDZEKQcxSmw2hgFnes33-FnhxStKo6x4VU3pSy0CtqtLY8R8dVGL5zQMONkGgZetFSsr_OzkSalkH_uJYqs5jTSS3rNpcV0s3duwLtAVOp-kzdzOoi8/s400/Doubly+Linked+List.png&quot; border=&quot;0&quot; alt=&quot;Doubly Linked List&quot; title=&quot;Doubly Linked List&quot; id=&quot;BLOGGER_PHOTO_ID_5661200704473884882&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/262922269420347371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/doubly-linked-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/262922269420347371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/262922269420347371'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/doubly-linked-list.html' title='Doubly Linked List'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDM4GR2OLiupOgxrXuxtVcTfbVHDZEKQcxSmw2hgFnes33-FnhxStKo6x4VU3pSy0CtqtLY8R8dVGL5zQMONkGgZetFSsr_OzkSalkH_uJYqs5jTSS3rNpcV0s3duwLtAVOp-kzdzOoi8/s72-c/Doubly+Linked+List.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-3740871676780869424</id><published>2011-10-03T15:10:00.000-07:00</published><updated>2011-10-03T15:15:52.423-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++11"/><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><title type='text'>C++11 Features in Visual C++ 11</title><content type='html'>&lt;img style=&quot;float:right; margin:0 0 10px 10px;width: 109px; height: 35px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTn3S-wL4eUekCM-J2csu2cwjLy9ApGj2fZ50UQ8ieAtmXQGIMuTC3DV2SBxWy-prxo5_ApGl9j-6IODV7FrAbcLrWycvCrpEtZxb5Bm9D6NTGMt699-2G49AQNp3PJSP6mVa1vXvWBbI/s200/msdn.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5659392829122971586&quot; /&gt;There&#39;s a new C++ Standard and a new version of Visual C++, and it&#39;s time to reveal what features from the former we&#39;re implementing in the latter!&lt;br /&gt;&lt;br /&gt;Here is a article from MSDN Blogs talking about the new &lt;a href=&quot;http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx&quot;&gt;C++11 Features in Visual C++ 11&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/3740871676780869424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/c11-features-in-visual-c-11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3740871676780869424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3740871676780869424'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/c11-features-in-visual-c-11.html' title='C++11 Features in Visual C++ 11'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTn3S-wL4eUekCM-J2csu2cwjLy9ApGj2fZ50UQ8ieAtmXQGIMuTC3DV2SBxWy-prxo5_ApGl9j-6IODV7FrAbcLrWycvCrpEtZxb5Bm9D6NTGMt699-2G49AQNp3PJSP6mVa1vXvWBbI/s72-c/msdn.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-5170608914930041363</id><published>2011-10-03T14:51:00.000-07:00</published><updated>2011-10-03T14:57:56.451-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Singly Linked List</title><content type='html'>example:&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class Node {&lt;br /&gt;    private:&lt;br /&gt;        Node(string s, Node* n);&lt;br /&gt;        string body;&lt;br /&gt;        Node* next;&lt;br /&gt;    friend class SinglyLinkedList;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Node::Node(string s, Node* n){&lt;br /&gt;    body = s;&lt;br /&gt;    next = n;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class SinglyLinkedList{&lt;br /&gt;    public:&lt;br /&gt;        SinglyLinkedList();&lt;br /&gt;        ~SinglyLinkedList();&lt;br /&gt;        void AddInFront(string s);&lt;br /&gt;        void RemoveInFront();&lt;br /&gt;        void ShowAll();&lt;br /&gt;    private:&lt;br /&gt;        Node* head;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;SinglyLinkedList::SinglyLinkedList(){&lt;br /&gt;    head = NULL;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;SinglyLinkedList::~SinglyLinkedList(){&lt;br /&gt;    while (head != NULL){&lt;br /&gt;        RemoveInFront();&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void SinglyLinkedList::AddInFront(string s){&lt;br /&gt;    Node* n = new Node(s, head);&lt;br /&gt;    head = n;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void SinglyLinkedList::RemoveInFront(){&lt;br /&gt;    if(head != NULL){&lt;br /&gt;        Node* tmp = head;&lt;br /&gt;        head = head-&amp;gt;next;&lt;br /&gt;        delete tmp;&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void SinglyLinkedList::ShowAll(){&lt;br /&gt;    Node* n = head;&lt;br /&gt;    while(n != NULL){&lt;br /&gt;        cout &amp;lt;&amp;lt; n -&amp;gt; body &amp;lt;&amp;lt; endl;&lt;br /&gt;        n = n -&amp;gt; next;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;- Singly Linked List exercise -&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Create a new SinglyLinkedList: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    SinglyLinkedList mySinglyLinkedList;&lt;br /&gt;    mySinglyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Remove nothing in a empty Singly Linked List: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    mySinglyLinkedList.RemoveInFront();&lt;br /&gt;    mySinglyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Insert something: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    mySinglyLinkedList.AddInFront(&quot;ABC&quot;);&lt;br /&gt;    mySinglyLinkedList.AddInFront(&quot;DEFGH&quot;);&lt;br /&gt;    mySinglyLinkedList.AddInFront(&quot;I&quot;);&lt;br /&gt;    mySinglyLinkedList.AddInFront(&quot;JK&quot;);&lt;br /&gt;    mySinglyLinkedList.AddInFront(&quot;LMN&quot;);&lt;br /&gt;    mySinglyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Remove something: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    mySinglyLinkedList.RemoveInFront();&lt;br /&gt;    mySinglyLinkedList.RemoveInFront();&lt;br /&gt;    mySinglyLinkedList.ShowAll();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7O2tv-3ku5EatrZfIr5qBLyWvaC0JttgS7U1IXx76e6vZZqGl-4mNhnSGpD9Y-ChJQu5QQssdao7wSQDqxCpP55cc3dgSxWz0LYeomFzDey-qM9owpFPX946zkcd6wj5sDHCTIrABvJ0/s1600/Singly+Linked+List.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7O2tv-3ku5EatrZfIr5qBLyWvaC0JttgS7U1IXx76e6vZZqGl-4mNhnSGpD9Y-ChJQu5QQssdao7wSQDqxCpP55cc3dgSxWz0LYeomFzDey-qM9owpFPX946zkcd6wj5sDHCTIrABvJ0/s400/Singly+Linked+List.png&quot; border=&quot;0&quot; alt=&quot;Singly Linked List&quot; title=&quot;Singly Linked List&quot; id=&quot;BLOGGER_PHOTO_ID_5659388316061568722&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/5170608914930041363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/singly-linked-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/5170608914930041363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/5170608914930041363'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/singly-linked-list.html' title='Singly Linked List'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7O2tv-3ku5EatrZfIr5qBLyWvaC0JttgS7U1IXx76e6vZZqGl-4mNhnSGpD9Y-ChJQu5QQssdao7wSQDqxCpP55cc3dgSxWz0LYeomFzDey-qM9owpFPX946zkcd6wj5sDHCTIrABvJ0/s72-c/Singly+Linked+List.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-144075463968190411</id><published>2011-10-03T02:06:00.000-07:00</published><updated>2011-10-03T02:09:12.068-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Sort STL vector of C++</title><content type='html'>example:&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;void showMyVector(const vector&amp;lt;int&amp;gt;&amp;amp; v);&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  vector&amp;lt;int&amp;gt; myVector;&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;Start with nothing&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  showMyVector(myVector);&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;Insert something&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  for (int i = 0; i &amp;lt; 10; i++) {&lt;br /&gt;    myVector.push_back(rand() % 100);&lt;br /&gt;  }&lt;br /&gt;  showMyVector(myVector);&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;Sort the vector&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  for (int i = 0; i &amp;lt; 10; i++) {&lt;br /&gt;    sort(myVector.begin(), myVector.end());&lt;br /&gt;  }&lt;br /&gt;  showMyVector(myVector);&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void showMyVector(const vector&amp;lt;int&amp;gt;&amp;amp; v){&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;myVector.empty: &quot; &amp;lt;&amp;lt; v.empty() &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;myVector.size(): &quot; &amp;lt;&amp;lt; v.size() &amp;lt;&amp;lt; endl;&lt;br /&gt;  for(unsigned i = 0; i &amp;lt; v.size(); i++){&lt;br /&gt;      cout &amp;lt;&amp;lt; v[i] &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxs24i-dm7LpRTScqIoupPqiEHgLVd4Sf_5sAdwkEeRH7N8OgNwYWp2e7p7ZIkrTJDcABGyXr_HOyB30F5aeY13Pxf0x36Lk1xd3azdc55FEIQ9NliQy8KAey7QYl9XHydULQ0_gaz7Yw/s1600/SortVector.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxs24i-dm7LpRTScqIoupPqiEHgLVd4Sf_5sAdwkEeRH7N8OgNwYWp2e7p7ZIkrTJDcABGyXr_HOyB30F5aeY13Pxf0x36Lk1xd3azdc55FEIQ9NliQy8KAey7QYl9XHydULQ0_gaz7Yw/s400/SortVector.png&quot; border=&quot;0&quot; alt=&quot;Sort STL vector of C++&quot; title=&quot;Sort STL vector of C++&quot; id=&quot;BLOGGER_PHOTO_ID_5659190280767332962&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/144075463968190411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/sort-stl-vector-of-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/144075463968190411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/144075463968190411'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/sort-stl-vector-of-c.html' title='Sort STL vector of C++'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxs24i-dm7LpRTScqIoupPqiEHgLVd4Sf_5sAdwkEeRH7N8OgNwYWp2e7p7ZIkrTJDcABGyXr_HOyB30F5aeY13Pxf0x36Lk1xd3azdc55FEIQ9NliQy8KAey7QYl9XHydULQ0_gaz7Yw/s72-c/SortVector.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-3956164557213424574</id><published>2011-10-02T15:55:00.001-07:00</published><updated>2011-10-02T15:56:25.540-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>STL vector of C++</title><content type='html'>example:&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;vector&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;void showMyVector(const vector&amp;lt;int&amp;gt;&amp;amp; v);&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  vector&amp;lt;int&amp;gt; myVector;&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;Start with nothing&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  showMyVector(myVector);&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;Insert something&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  myVector.push_back(0);&lt;br /&gt;  myVector.push_back(1);&lt;br /&gt;  myVector.push_back(2);&lt;br /&gt;  myVector.push_back(3);&lt;br /&gt;  myVector.push_back(4);&lt;br /&gt;  myVector.push_back(5);&lt;br /&gt;  myVector.insert(myVector.begin()+2, 9);&lt;br /&gt;  myVector.insert(myVector.end()-1, 10);&lt;br /&gt;  myVector.pop_back();&lt;br /&gt;  showMyVector(myVector);&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;Clear&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  myVector.clear();&lt;br /&gt;  showMyVector(myVector);&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void showMyVector(const vector&amp;lt;int&amp;gt;&amp;amp; v){&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;myVector.empty: &quot; &amp;lt;&amp;lt; v.empty() &amp;lt;&amp;lt; endl;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;myVector.size(): &quot; &amp;lt;&amp;lt; v.size() &amp;lt;&amp;lt; endl;&lt;br /&gt;  for(unsigned i = 0; i &amp;lt; v.size(); i++){&lt;br /&gt;      cout &amp;lt;&amp;lt; v[i] &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxAXyDm7BovJt7VdgnRbvBU_Er7XX1TrxsuU3tIIIXQ4APyE5Lg9APK-anrM4hn7ljXp7iAslqH7ySmfauvx3e-i5WPo3zO51e-wrJ4CqJ5hbsCLrohUVpevuIALLevDxOIcdxELnS78A/s1600/vector.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxAXyDm7BovJt7VdgnRbvBU_Er7XX1TrxsuU3tIIIXQ4APyE5Lg9APK-anrM4hn7ljXp7iAslqH7ySmfauvx3e-i5WPo3zO51e-wrJ4CqJ5hbsCLrohUVpevuIALLevDxOIcdxELnS78A/s400/vector.png&quot; border=&quot;0&quot; alt=&quot;STL vector of C++&quot; title=&quot;STL vector of C++&quot; id=&quot;BLOGGER_PHOTO_ID_5659032363537949266&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/3956164557213424574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/10/stl-vector-of-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3956164557213424574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3956164557213424574'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/10/stl-vector-of-c.html' title='STL vector of C++'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxAXyDm7BovJt7VdgnRbvBU_Er7XX1TrxsuU3tIIIXQ4APyE5Lg9APK-anrM4hn7ljXp7iAslqH7ySmfauvx3e-i5WPo3zO51e-wrJ4CqJ5hbsCLrohUVpevuIALLevDxOIcdxELnS78A/s72-c/vector.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-204285027360718562</id><published>2011-09-30T12:04:00.000-07:00</published><updated>2011-09-30T12:09:26.369-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Qt, a cross-platform application framework - updated version 1.1.3</title><content type='html'>&lt;img style=&quot;float:right; margin:0 0 10px 10px;width: 64px; height: 79px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmDnLqz5B-zpMTlpng9MoXMQjEBZOUh4TH0M-16Nyl9lPE44U0DoqwKx3bzkmHecJFgmBcATCz0-Aemp6dGdEl2tzv4BN2PmPWR0iljdt0ZVWxZU9nVvTRwogrtXhC5IWO9C9yt9ACaaw/s200/Qt.png&quot; border=&quot;0&quot; alt=&quot;Qt&quot; title=&quot;Qt&quot; id=&quot;BLOGGER_PHOTO_ID_5658231660135667186&quot; /&gt;&lt;br /&gt;The Qt SDK includes the tools you need to build desktop, embedded and mobile applications with Qt from a single install. This is the recommended way to get started with Qt. The latest SDK has a self updater feature that will keep you up to date as new versions are made available.&lt;br /&gt;&lt;br /&gt;To align with the Nokia N9 release, Qt SDK updated version 1.1.3.&lt;br /&gt;&lt;br /&gt;website: &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;http://qt.nokia.com/&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/204285027360718562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/qt-cross-platform-application-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/204285027360718562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/204285027360718562'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/qt-cross-platform-application-framework.html' title='Qt, a cross-platform application framework - updated version 1.1.3'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmDnLqz5B-zpMTlpng9MoXMQjEBZOUh4TH0M-16Nyl9lPE44U0DoqwKx3bzkmHecJFgmBcATCz0-Aemp6dGdEl2tzv4BN2PmPWR0iljdt0ZVWxZU9nVvTRwogrtXhC5IWO9C9yt9ACaaw/s72-c/Qt.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-1599886458118960163</id><published>2011-09-28T04:33:00.001-07:00</published><updated>2011-09-28T04:55:14.507-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="how to"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>First exercise using Keil uVision 4 for 8051 micro-controller</title><content type='html'>It&#39;s easy to create a 8051 project using &lt;a href=&quot;http://c-exercise.blogspot.com/2011/09/keil-8051-development-tools.html&quot;&gt;Keil 8051 Development Tools, uVision 4&lt;/a&gt;. You can also debug the program using the build-in simulator.&lt;br /&gt;&lt;br /&gt;- New a uVision Project in uVision 4 IDE.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg_ss6AZsAhtTkOXvl7hQ_7lq0i-SH3VmBGYTsWu6JKIoO9rB02yyh4L3GfizaOJjJEXW44V3yLLI9rzg-PKraZv83v3bfi3xKTFLpWeCMRxrGkRFNbDLVAE3IbBWVapfZqU4hrpKFuOU/s1600/uVision_8051_01.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg_ss6AZsAhtTkOXvl7hQ_7lq0i-SH3VmBGYTsWu6JKIoO9rB02yyh4L3GfizaOJjJEXW44V3yLLI9rzg-PKraZv83v3bfi3xKTFLpWeCMRxrGkRFNbDLVAE3IbBWVapfZqU4hrpKFuOU/s400/uVision_8051_01.png&quot; border=&quot;0&quot; alt=&quot;New a uVision Project&quot; title=&quot;New a uVision Project&quot; id=&quot;BLOGGER_PHOTO_ID_5657376826226744786&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Select project location and file name.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu7nmKbf69laxfc6RNeKOKNqFR1ZcUYAm9DKxyuCk2vtixXB2p2rOoUAxtRSwx80YEqINw-1Ah4dqIrKiTnq4d6hyphenhyphenqlxC_3Ojn-z2UoqpN8IAPxEAu37vfhE7la4PolPvrwiG_IPF2XgY/s1600/uVision_8051_02.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 307px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu7nmKbf69laxfc6RNeKOKNqFR1ZcUYAm9DKxyuCk2vtixXB2p2rOoUAxtRSwx80YEqINw-1Ah4dqIrKiTnq4d6hyphenhyphenqlxC_3Ojn-z2UoqpN8IAPxEAu37vfhE7la4PolPvrwiG_IPF2XgY/s400/uVision_8051_02.png&quot; border=&quot;0&quot; alt=&quot;Select project location and file name&quot; title=&quot;Select project location and file name&quot; id=&quot;BLOGGER_PHOTO_ID_5657376547607908354&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Select 8051 (all Variants) under Generic in Data base, and click OK.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzpc7nkrQ8oNOF5qzAYiL-aZwhNBFVTmDR0JcM__m0F42_p5ZlJQRQaTgQegn8bAhi3eEiEOg201KcvLYgMpd5YqIs96_ahyJXskA9ZSpp31Fy0kwvALyvOvmUfwPSi3g1JXZEtU-pj7g/s1600/uVision_8051_03.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 295px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzpc7nkrQ8oNOF5qzAYiL-aZwhNBFVTmDR0JcM__m0F42_p5ZlJQRQaTgQegn8bAhi3eEiEOg201KcvLYgMpd5YqIs96_ahyJXskA9ZSpp31Fy0kwvALyvOvmUfwPSi3g1JXZEtU-pj7g/s400/uVision_8051_03.png&quot; border=&quot;0&quot; alt=&quot;Select 8051 (all Variants)&quot; title=&quot;Select 8051 (all Variants)&quot; id=&quot;BLOGGER_PHOTO_ID_5657376216380239538&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Accept Copy Standard 8051 Startup Code to Project Folder and Add File to Project. The IDE will copy STARTUP.A51 file for you.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMt60PGNaHLKu89rQMXRmv_rw_HTK5EO5jH-Kq0Vcum9q-4WixFYIbhRmQcrKFuaM7CqXhP-Mib24eT2rePhJmQzPcNL0xQiYbwYSGLuP7AwApV3hZQLqnbRAIniG6-H1wFWkV1EYc87w/s1600/uVision_8051_04.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 139px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMt60PGNaHLKu89rQMXRmv_rw_HTK5EO5jH-Kq0Vcum9q-4WixFYIbhRmQcrKFuaM7CqXhP-Mib24eT2rePhJmQzPcNL0xQiYbwYSGLuP7AwApV3hZQLqnbRAIniG6-H1wFWkV1EYc87w/s400/uVision_8051_04.png&quot; border=&quot;0&quot; alt=&quot;Copy Standard 8051 Startup Code to Project Folder and Add File to Project&quot; title=&quot;Copy Standard 8051 Startup Code to Project Folder and Add File to Project&quot; id=&quot;BLOGGER_PHOTO_ID_5657375896091650642&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Right click th project &quot;Target1&quot; and select Options for Target &#39;Target1&#39;...&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAAH0eu5aY4oH9SD2VfKXlqvWqK2PY6jzZaiRBCPJv_pWW0oVU9FmC27DHYAAPbCbybrmzq_SXDvHAXN44D1L5tE5BJKoX6nAKmRYSmzuoWmDrY4UfRMUDGmZMocARsH4AWVhOLXB4Nm8/s1600/uVision_8051_05.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAAH0eu5aY4oH9SD2VfKXlqvWqK2PY6jzZaiRBCPJv_pWW0oVU9FmC27DHYAAPbCbybrmzq_SXDvHAXN44D1L5tE5BJKoX6nAKmRYSmzuoWmDrY4UfRMUDGmZMocARsH4AWVhOLXB4Nm8/s400/uVision_8051_05.png&quot; border=&quot;0&quot; alt=&quot;Select Options for Target&quot; title=&quot;Select Options for Target&quot; id=&quot;BLOGGER_PHOTO_ID_5657375518466892818&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Select Small Memory Model and Small Code Rom Size, and click OK.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsObbX-2JjVp-dPLiRlgKM23sG13_0IJ_3sY66x4smYr_bLdZhbTfXHFDg32dZRC9jakN6VZq3z7FiB3Sqg9Oi1AV1D5XadSvWH9fA4yxZMQuPRbCmE1S1-87ZXSv5zdvNi3YwkRiGm-U/s1600/uVision_8051_06.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 295px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsObbX-2JjVp-dPLiRlgKM23sG13_0IJ_3sY66x4smYr_bLdZhbTfXHFDg32dZRC9jakN6VZq3z7FiB3Sqg9Oi1AV1D5XadSvWH9fA4yxZMQuPRbCmE1S1-87ZXSv5zdvNi3YwkRiGm-U/s400/uVision_8051_06.png&quot; border=&quot;0&quot; alt=&quot;Config memory model&quot; title=&quot;Config memory model&quot; id=&quot;BLOGGER_PHOTO_ID_5657375157650121522&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Click File -&amp;gt; New... to creat your main.c&lt;br /&gt;&lt;br /&gt;- Type in the program, and save it as main.c.&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;reg51.h&amp;gt;&lt;br /&gt;&lt;br /&gt;void DummyDelay();&lt;br /&gt;&lt;br /&gt;void main(void){&lt;br /&gt; char c = 0x00;&lt;br /&gt; while(1){&lt;br /&gt;  P1 = c++;&lt;br /&gt;  DummyDelay();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void DummyDelay(){&lt;br /&gt; unsigned char i, j;&lt;br /&gt;&lt;br /&gt; for(i = 0; i &amp;lt; 0xFF; i++){&lt;br /&gt;  for(j = 0; j &amp;lt; 0xFF; j++){&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnhHcX_Lk3uH5KU0UW6FWkJki_hNfVTyP9y6Td-S9M7L1NEgUR5db4h0cxCoKPoWXstk79V6kEx0pCLfg3rsaKR8joicrMnhEYznm1hFAUxYGVJpWjZ2kEPfjZGL-S0qSDtB88PlUHyUA/s1600/uVision_8051_07.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 222px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnhHcX_Lk3uH5KU0UW6FWkJki_hNfVTyP9y6Td-S9M7L1NEgUR5db4h0cxCoKPoWXstk79V6kEx0pCLfg3rsaKR8joicrMnhEYznm1hFAUxYGVJpWjZ2kEPfjZGL-S0qSDtB88PlUHyUA/s400/uVision_8051_07.png&quot; border=&quot;0&quot; alt=&quot;Edit the code&quot; title=&quot;Edit the code&quot; id=&quot;BLOGGER_PHOTO_ID_5657374785591831538&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Right click Source Group 1 under Target1 in Project, and Add Files to Group &#39;Source Group 1&#39;...&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3hyMneFi852aysxz1WNRW5fLXfVPj5lmqh2Csv52wgrJzwewJFIFreupUzDI2WlVBObjRgi2X0AAFBe2VP066p0daS9BhNixw2i44GXwVghhFJ6MskvFKy4X2BTzlCAK5rAxa4pN5XB8/s1600/uVision_8051_08.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3hyMneFi852aysxz1WNRW5fLXfVPj5lmqh2Csv52wgrJzwewJFIFreupUzDI2WlVBObjRgi2X0AAFBe2VP066p0daS9BhNixw2i44GXwVghhFJ6MskvFKy4X2BTzlCAK5rAxa4pN5XB8/s400/uVision_8051_08.png&quot; border=&quot;0&quot; alt=&quot;Add Files to Source Group&quot; title=&quot;Add Files to Source Group&quot; id=&quot;BLOGGER_PHOTO_ID_5657374458501029986&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Browse to select the main.c just created.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUaf1tJrbiJ4TAaYEOGHe0hUvtJEbrXfz2wax9bxSallUSidjllduO4lA5eROnV-mOcldrnFN2Ads6LPBTb1ym1XWIS58OfNXQwNoX9AEq0EErUV3aCLvJnRFhJ7iXkFBWlmRDPFBh-Po/s1600/uVision_8051_09.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 278px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUaf1tJrbiJ4TAaYEOGHe0hUvtJEbrXfz2wax9bxSallUSidjllduO4lA5eROnV-mOcldrnFN2Ads6LPBTb1ym1XWIS58OfNXQwNoX9AEq0EErUV3aCLvJnRFhJ7iXkFBWlmRDPFBh-Po/s400/uVision_8051_09.png&quot; border=&quot;0&quot; alt=&quot;Add main.c&quot; title=&quot;Add main.c&quot; id=&quot;BLOGGER_PHOTO_ID_5657374106503284466&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Click Project to Build Target.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT8nBYOiTRWYVJOEBYH46ArA4Rr1srYLc_TS9GbXjbIZMppjsTIUEVmt08bZJi8otP5y6nV6FiXZVt-QDMen4MCXlzBXK4TnOBvX9jBT4u6YEVI5Zt-kbcsjtAQxcBKmmiIR9wcRgI3DI/s1600/uVision_8051_10.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT8nBYOiTRWYVJOEBYH46ArA4Rr1srYLc_TS9GbXjbIZMppjsTIUEVmt08bZJi8otP5y6nV6FiXZVt-QDMen4MCXlzBXK4TnOBvX9jBT4u6YEVI5Zt-kbcsjtAQxcBKmmiIR9wcRgI3DI/s400/uVision_8051_10.png&quot; border=&quot;0&quot; alt=&quot;Build Target&quot; title=&quot;Build Target&quot; id=&quot;BLOGGER_PHOTO_ID_5657373633226920274&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- After finished without Errors. Click Debug and Start/Stop Debug Session.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9vQvO9BF4RKAmZOG9WLAVhXlFM7Q0X1FrK07YZoNVla7OqaElP8F55A6QZ3VSNEzuAk3qKO2skgr4xmB4bPbMsXQj60u7_YZR6d4xZPyrJ5DSqUc0iiiqLx5ynKuxRFLHtyFSYP7BFAU/s1600/uVision_8051_11.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9vQvO9BF4RKAmZOG9WLAVhXlFM7Q0X1FrK07YZoNVla7OqaElP8F55A6QZ3VSNEzuAk3qKO2skgr4xmB4bPbMsXQj60u7_YZR6d4xZPyrJ5DSqUc0iiiqLx5ynKuxRFLHtyFSYP7BFAU/s400/uVision_8051_11.png&quot; border=&quot;0&quot; alt=&quot;Start Debug Session&quot; title=&quot;Start Debug Session&quot; id=&quot;BLOGGER_PHOTO_ID_5657373328461269826&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Click Peripherals -&amp;gt; I/O - Ports -&amp;gt; Port 1 to open the Parallel Port 1 monitor window.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqDjY5l0zbH_lA9mtdpVOYdIPos5WjvwH0HW72PWVyJJ7F_fcIu5RO585aeFr7MBk5w6yUa3hQbwPZrmf1B2CUCfhikLyp6PLp-svCBIsdZilHVB7NTL8i4g-yB226W9TA2HJmfWI7xOs/s1600/uVision_8051_12.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqDjY5l0zbH_lA9mtdpVOYdIPos5WjvwH0HW72PWVyJJ7F_fcIu5RO585aeFr7MBk5w6yUa3hQbwPZrmf1B2CUCfhikLyp6PLp-svCBIsdZilHVB7NTL8i4g-yB226W9TA2HJmfWI7xOs/s400/uVision_8051_12.png&quot; border=&quot;0&quot; alt=&quot;Open Port 1 Monitor&quot; title=&quot;Open Port 1 Monitor&quot; id=&quot;BLOGGER_PHOTO_ID_5657372943112378610&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXGZ674fwz44hpHHcbRihfnw63o0pD0-OCmeUrORS6cqA7F9u1Ss-aKQ74JReIHSMdvsBQxVD4dI1zDPgz8-fryGx8B6HBDEIUqOY-PdT5Jm-GNNPN5DGQXDHnIGGnOh-LWT8H8hbWwhc/s1600/uVision_8051_13.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 198px; height: 104px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXGZ674fwz44hpHHcbRihfnw63o0pD0-OCmeUrORS6cqA7F9u1Ss-aKQ74JReIHSMdvsBQxVD4dI1zDPgz8-fryGx8B6HBDEIUqOY-PdT5Jm-GNNPN5DGQXDHnIGGnOh-LWT8H8hbWwhc/s400/uVision_8051_13.png&quot; border=&quot;0&quot; alt=&quot;Port 1 Monitor&quot; title=&quot;Port 1 Monitor&quot; id=&quot;BLOGGER_PHOTO_ID_5657372720586975810&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Finally click on the Run icon, or F5, to run the program in simulated mode. You can see the Port 1 Bits in Parallel Port 1 monitor change while the program running.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEjJi74sCh7UGbI9AJty-9SO2rneAE5da-auknglKjJ7TMyHy-Ihs2B6zf6JjLbQ-xVG6_pjlwqw7jT1ZzjsRWQ_OCldo2q2GSXXHTpETswx43L6nZEpGIHA166IFw9b-b-52I_68v4vo/s1600/uVision_8051_14.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 234px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEjJi74sCh7UGbI9AJty-9SO2rneAE5da-auknglKjJ7TMyHy-Ihs2B6zf6JjLbQ-xVG6_pjlwqw7jT1ZzjsRWQ_OCldo2q2GSXXHTpETswx43L6nZEpGIHA166IFw9b-b-52I_68v4vo/s400/uVision_8051_14.png&quot; border=&quot;0&quot; alt=&quot;Running in Simulator&quot; title=&quot;Running in Simulator&quot; id=&quot;BLOGGER_PHOTO_ID_5657372258967687650&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Click Debug and Start/Stop Debug Session, or Ctrl-F5 to exit and back to edit mode.</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/1599886458118960163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/first-exercise-using-keil-uvision-4-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/1599886458118960163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/1599886458118960163'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/first-exercise-using-keil-uvision-4-for.html' title='First exercise using Keil uVision 4 for 8051 micro-controller'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg_ss6AZsAhtTkOXvl7hQ_7lq0i-SH3VmBGYTsWu6JKIoO9rB02yyh4L3GfizaOJjJEXW44V3yLLI9rzg-PKraZv83v3bfi3xKTFLpWeCMRxrGkRFNbDLVAE3IbBWVapfZqU4hrpKFuOU/s72-c/uVision_8051_01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-537620141714735459</id><published>2011-09-27T12:17:00.000-07:00</published><updated>2011-09-27T12:19:24.401-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Pointer and Array</title><content type='html'>In this exercise, an array of int and another array of char are created. On the other hand, a pointer to int and a pointer to char is defined. And then the pointers are assigned to the address of the arrays, and the elements of the array can be accessed by *(pointer + offset).&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjakSoHA0mbn2MRgcTMy0ctowgHfG0lNcL5VJAVD493ar3Lwy_Sux8k2ZT2tCGY8uyMw-Qd1-91w0Z04-h4sJ6vt6u7zIGVtPt-bfwDAqAgaUN8IqZo0wBzZMVW1IFCyhaoPe-UV_riow/s1600/Pointer+and+Array.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjakSoHA0mbn2MRgcTMy0ctowgHfG0lNcL5VJAVD493ar3Lwy_Sux8k2ZT2tCGY8uyMw-Qd1-91w0Z04-h4sJ6vt6u7zIGVtPt-bfwDAqAgaUN8IqZo0wBzZMVW1IFCyhaoPe-UV_riow/s400/Pointer+and+Array.png&quot; border=&quot;0&quot; alt=&quot;Pointer and Array&quot; title=&quot;Pointer and Array&quot; id=&quot;BLOGGER_PHOTO_ID_5657120992856735858&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;const int LEN = 10;&lt;br /&gt;int A_int[LEN];&lt;br /&gt;int* ptA_int;&lt;br /&gt;char A_char[LEN];&lt;br /&gt;char* ptA_char;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;Pointer and Array&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    int i;&lt;br /&gt;    char c;&lt;br /&gt;&lt;br /&gt;    for (i = 0, c = &#39;a&#39;; i &amp;lt; LEN; i++, c++){&lt;br /&gt;        A_int[i] = i;&lt;br /&gt;        A_char[i] = c;&lt;br /&gt;        cout &amp;lt;&amp;lt; A_int[i] &amp;lt;&amp;lt; &quot;/&quot; &amp;lt;&amp;lt; A_char[i] &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;    }&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    ptA_int = A_int;&lt;br /&gt;    ptA_char = A_char;&lt;br /&gt;    for (i = 0; i &amp;lt; LEN; i++){&lt;br /&gt;        cout &amp;lt;&amp;lt; *(ptA_int + i) &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;    }&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    for (i = 0; i &amp;lt; LEN; i++){&lt;br /&gt;        cout &amp;lt;&amp;lt; *(ptA_char + i) &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;    }&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/537620141714735459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/pointer-and-array_27.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/537620141714735459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/537620141714735459'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/pointer-and-array_27.html' title='Pointer and Array'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjakSoHA0mbn2MRgcTMy0ctowgHfG0lNcL5VJAVD493ar3Lwy_Sux8k2ZT2tCGY8uyMw-Qd1-91w0Z04-h4sJ6vt6u7zIGVtPt-bfwDAqAgaUN8IqZo0wBzZMVW1IFCyhaoPe-UV_riow/s72-c/Pointer+and+Array.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-5319719774865349767</id><published>2011-09-27T02:30:00.000-07:00</published><updated>2011-09-28T04:59:02.837-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Keil 8051 Development Tools</title><content type='html'>The &lt;a href=&quot;http://www.keil.com/c51/&quot;&gt;&lt;b&gt;Keil 8051 Development Tools&lt;/b&gt;&lt;/a&gt; are designed to solve the complex problems facing embedded software developers.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;When starting a new project, simply select the microcontroller you use from the Device Database and the µVision IDE sets all compiler, assembler, linker, and memory options for you.&lt;/li&gt;&lt;li&gt;Numerous example programs are included to help you get started with the most popular embedded 8051 devices.&lt;/li&gt;&lt;li&gt;The Keil µVision Debugger accurately simulates on-chip peripherals (I²C, CAN, UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of your 8051 device. Simulation helps you understand hardware configurations and avoids time wasted on setup problems. Additionally, with simulation, you can write and test applications before target hardware is available.&lt;/li&gt;&lt;li&gt;When you are ready to begin testing your software application with target hardware, use the MON51, MON390, MONADI, or FlashMON51 Target Monitors, the ISD51 In-System Debugger, or the ULINK USB-JTAG Adapter to download and test program code on your target system.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;width: 371px; height: 240px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizuOFgPZ-cWQtw1hj3o9FSH_XDLt8olZRADzyJ-fIHXqk3WxAZc7ZwisM0CSOinObOXsaUKirjW0eRZ5m7dEsO3PPMVmnxbHi5Zw4EO-4Zc9o8zQNwBeLv8LmbqsKcPc66EjSQePO1axY/s400/devproc_c51a.png&quot; border=&quot;0&quot; alt=&quot;Overview of C51 Microcontrollers Development Tool&quot; title=&quot;Overview of C51 Microcontrollers Development Tool&quot; id=&quot;BLOGGER_PHOTO_ID_5656970247163311954&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.keil.com/demo/eval/c51.htm&quot;&gt;Download FREE Keil C51 Evaluation Kit&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); &quot;&gt;&lt;h5 style=&quot;margin-bottom: 0px; padding-bottom: 0px; font: normal normal bold 10pt/normal verdana, sans-serif; padding-top: 15px; &quot;&gt;C51 Evaluation Tools Limitations&lt;/h5&gt;&lt;ul style=&quot;list-style-type: square; font-size: 10pt; margin-top: 6px; margin-right: 0px; margin-bottom: 16px; margin-left: 28px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; &quot;&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;The 8051 compiler, assembler, linker, and debugger are limited to 2 Kbytes of object code. Source code may be of any size.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Programs that generate more than 2 Kbytes of object code will not compile, assemble, or link.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;The debugger supports programs that are 2 Kbytes or smaller.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;The startup code generated includes LJMPs. Code generated cannot be used in single-chip devices that support 2 Kbytes or less of program space.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Programs start at offset 0x0800. Programs generated with the evaluation software may not be programmed into single-chip devices with less than 2 Kbytes of on-chip ROM.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;No hardware support for multiple DPTR registers is provided.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;No support for floating-point arithmetic and no support for user libraries is provided.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;No support for in-line assembly using #pragma ASM.&lt;/li&gt;&lt;li style=&quot;padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;The following components which are present in the PK51 Full Version are not included in the Evaluation Version: Linker for Code Banking, Library Manager, and RTX51 Tiny Real-time Operating System.&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Refer: &lt;a href=&quot;http://c-exercise.blogspot.com/2011/09/first-exercise-using-keil-uvision-4-for.html&quot;&gt;First exercise using Keil uVision 4 for 8051 micro-controller&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/5319719774865349767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/keil-8051-development-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/5319719774865349767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/5319719774865349767'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/keil-8051-development-tools.html' title='Keil 8051 Development Tools'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizuOFgPZ-cWQtw1hj3o9FSH_XDLt8olZRADzyJ-fIHXqk3WxAZc7ZwisM0CSOinObOXsaUKirjW0eRZ5m7dEsO3PPMVmnxbHi5Zw4EO-4Zc9o8zQNwBeLv8LmbqsKcPc66EjSQePO1axY/s72-c/devproc_c51a.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-1614278895926368352</id><published>2011-09-26T14:03:00.001-07:00</published><updated>2011-09-26T14:05:23.252-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Implement Insertion sort in C/C++</title><content type='html'>&lt;a href=&quot;http://en.wikipedia.org/wiki/Insertion_sort&quot;&gt;Insertion sort&lt;/a&gt; is a simple sorting algorithm: a comparison sort in which the sorted array (or list) is built one entry at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtbs-ald0UJt4wdm4hUKgD1FauUOVNd_yFlI7WnR2EmiHTiw5yRANxv2Q3-YrTczp2HKD6hVWaHLOMj5zQpLZnPbEMo7pH7mwcMfKNi__dv2BLsOlknQyVopAG0F-nc-1Fk7P819riFxg/s1600/Insertion+Sort.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtbs-ald0UJt4wdm4hUKgD1FauUOVNd_yFlI7WnR2EmiHTiw5yRANxv2Q3-YrTczp2HKD6hVWaHLOMj5zQpLZnPbEMo7pH7mwcMfKNi__dv2BLsOlknQyVopAG0F-nc-1Fk7P819riFxg/s400/Insertion+Sort.png&quot; border=&quot;0&quot; alt=&quot;Insertion sort&quot; title=&quot;Insertion sort&quot; id=&quot;BLOGGER_PHOTO_ID_5656777044750248866&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;void InsertionSort(int* ar, int len);&lt;br /&gt;&lt;br /&gt;const int LENGTH = 10;&lt;br /&gt;int data[LENGTH];&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  //Prepare data&lt;br /&gt;  for (int i = 0; i &amp;lt; 10; i++) {&lt;br /&gt;      data[i] = rand() % 100;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;data before Insertion Sort:&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  for (int i = 0; i &amp;lt; 10; i++)&lt;br /&gt;      cout &amp;lt;&amp;lt; data[i] &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;  cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  InsertionSort(data, LENGTH);&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; &quot;data before Insertion Sort:&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  for (int i = 0; i &amp;lt; 10; i++)&lt;br /&gt;      cout &amp;lt;&amp;lt; data[i] &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void InsertionSort(int* ar, int len){&lt;br /&gt;  int cur, j;&lt;br /&gt;&lt;br /&gt;  for (int i = 1; i &amp;lt; len; i++) {&lt;br /&gt;      cur = ar[i];&lt;br /&gt;      j = i - 1;&lt;br /&gt;      while ((j &amp;gt;= 0) &amp;amp;&amp;amp; (ar[j] &amp;gt; cur)) {&lt;br /&gt;          ar[j + 1] = ar[j];&lt;br /&gt;          j--;&lt;br /&gt;      }&lt;br /&gt;      ar[j + 1] = cur;&lt;br /&gt;&lt;br /&gt;      for (int ii = 0; ii &amp;lt; 10; ii++)&lt;br /&gt;          cout &amp;lt;&amp;lt; ar[ii] &amp;lt;&amp;lt; &quot; &quot;;&lt;br /&gt;      cout &amp;lt;&amp;lt; endl;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/1614278895926368352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/implement-insertion-sort-in-cc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/1614278895926368352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/1614278895926368352'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/implement-insertion-sort-in-cc.html' title='Implement Insertion sort in C/C++'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtbs-ald0UJt4wdm4hUKgD1FauUOVNd_yFlI7WnR2EmiHTiw5yRANxv2Q3-YrTczp2HKD6hVWaHLOMj5zQpLZnPbEMo7pH7mwcMfKNi__dv2BLsOlknQyVopAG0F-nc-1Fk7P819riFxg/s72-c/Insertion+Sort.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-3081945972832261879</id><published>2011-09-25T07:48:00.001-07:00</published><updated>2011-10-03T15:16:54.279-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="how to"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><title type='text'>Create HelloWorld Windows Form Application, using Visual C++ 2010 Express</title><content type='html'>Create HelloWorld Windows Form Application, using Visual C++ 2010 Express&lt;br /&gt;&lt;br /&gt;- Create New Project using template of Visual C++ Windows Form Application, with Name of &quot;HelloWorld&quot;, and click OK.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjP30ke089qeOnPJEhm86RRptKs8p0Zi_YFJ8zp8DhDI2Bkeqzb8z7vT9Ofj2YuqMLiMt6QERCCD8TE4xZZ3n66LTqlcbjoPcvaR4ROACTHLG_9gy1SxcvbwTDh58E5Sp2pmQyRbLQVU/s1600/HelloWorld_01.jpg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 220px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjP30ke089qeOnPJEhm86RRptKs8p0Zi_YFJ8zp8DhDI2Bkeqzb8z7vT9Ofj2YuqMLiMt6QERCCD8TE4xZZ3n66LTqlcbjoPcvaR4ROACTHLG_9gy1SxcvbwTDh58E5Sp2pmQyRbLQVU/s400/HelloWorld_01.jpg&quot; border=&quot;0&quot; alt=&quot;Create Visual C++ Windows Form Application&quot; title=&quot;Create Visual C++ Windows Form Application&quot; id=&quot;BLOGGER_PHOTO_ID_5656310066694328098&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Click on &quot;Toolbox&quot; on right to expand Toolbox, drag a label and button over the Form.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA5BfwWy3tBjBwU_csYvF_a03gaWYo6uPprJ7aod_QW3c6foWGqATnDFUp9iIutoYosF-sz50rdI3pZqw5hAX1lXnzhOmKSwljqEEw9svl3LKjPAQsjpkYCYwkO7vJVot5Pq95q8V8zUE/s1600/HelloWorld_02.jpg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA5BfwWy3tBjBwU_csYvF_a03gaWYo6uPprJ7aod_QW3c6foWGqATnDFUp9iIutoYosF-sz50rdI3pZqw5hAX1lXnzhOmKSwljqEEw9svl3LKjPAQsjpkYCYwkO7vJVot5Pq95q8V8zUE/s400/HelloWorld_02.jpg&quot; border=&quot;0&quot; alt=&quot;Place components&quot; title=&quot;Place components&quot; id=&quot;BLOGGER_PHOTO_ID_5656309777348800498&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Double Click on the button, to generate the code of button1_Click() method. Visual C++ will open the code designer for you.&lt;br /&gt;&lt;br /&gt;- Add the code inside button1_Click() method:&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt; private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {&lt;br /&gt;    label1-&amp;gt;Text = &quot;Hello World&quot;;&lt;br /&gt;   }&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOxMhU4KrzjRAHBoRGJk3UTBDcSwlxn2zgQYgoATz-Mfaf4WyMzXZBSqu8OofiHMkS1LzF9X0S1NKAsZEH7GWylAAnvAX15oOiP8h2Uouo_0FOsdQB8oecSzG8p6RavkLNOzblGO40hiY/s1600/HelloWorld_03.jpg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 241px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOxMhU4KrzjRAHBoRGJk3UTBDcSwlxn2zgQYgoATz-Mfaf4WyMzXZBSqu8OofiHMkS1LzF9X0S1NKAsZEH7GWylAAnvAX15oOiP8h2Uouo_0FOsdQB8oecSzG8p6RavkLNOzblGO40hiY/s400/HelloWorld_03.jpg&quot; border=&quot;0&quot; alt=&quot;Add code&quot; title=&quot;Add code&quot; id=&quot;BLOGGER_PHOTO_ID_5656309555565553746&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Save and Run.&lt;br /&gt;Click on the button, the text on the label will be changed to &quot;Hello World&quot;.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJx-J9RNr4ilR3hkrqXA6y_Y_pxcXBP8xWB3RRz9zBoHIJpN3WkRoYxcW8mWnfYLXls0LsQSfD1UcwlhLa75T1st3pfE_rlVVXbV2sG2JAlQ6NfugFeb9XY2bZJpEGNEA7a-5k01k-vS0/s1600/HelloWorld_04.jpg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 300px; height: 300px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJx-J9RNr4ilR3hkrqXA6y_Y_pxcXBP8xWB3RRz9zBoHIJpN3WkRoYxcW8mWnfYLXls0LsQSfD1UcwlhLa75T1st3pfE_rlVVXbV2sG2JAlQ6NfugFeb9XY2bZJpEGNEA7a-5k01k-vS0/s400/HelloWorld_04.jpg&quot; border=&quot;0&quot; alt=&quot;Hello World&quot; title=&quot;Hello World&quot; id=&quot;BLOGGER_PHOTO_ID_5656309323805593682&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/3081945972832261879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/create-helloworld-windows-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3081945972832261879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/3081945972832261879'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/create-helloworld-windows-form.html' title='Create HelloWorld Windows Form Application, using Visual C++ 2010 Express'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjP30ke089qeOnPJEhm86RRptKs8p0Zi_YFJ8zp8DhDI2Bkeqzb8z7vT9Ofj2YuqMLiMt6QERCCD8TE4xZZ3n66LTqlcbjoPcvaR4ROACTHLG_9gy1SxcvbwTDh58E5Sp2pmQyRbLQVU/s72-c/HelloWorld_01.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-8972826852842271258</id><published>2011-09-25T03:15:00.000-07:00</published><updated>2011-09-25T03:16:45.537-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>FREE NetBeans IDE</title><content type='html'>The &lt;a href=&quot;http://netbeans.org/&quot;&gt;&lt;b&gt;NetBeans IDE&lt;/b&gt;&lt;/a&gt; is an award-winning integrated development environment available for Windows, Mac, Linux, and Solaris. The NetBeans project consists of an open-source IDE and an application platform that enable developers to rapidly create web, enterprise, desktop, and mobile applications using the Java platform, as well as PHP, JavaScript and Ajax, Groovy and Grails, and C/C++.&lt;br /&gt;&lt;br /&gt;NetBeans web site: &lt;a href=&quot;http://netbeans.org/&quot;&gt;http://netbeans.org/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/8972826852842271258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/free-netbeans-ide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8972826852842271258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8972826852842271258'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/free-netbeans-ide.html' title='FREE NetBeans IDE'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-8505789552380709619</id><published>2011-09-22T00:08:00.000-07:00</published><updated>2011-10-03T15:17:12.170-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><title type='text'>Windows Runtime internals: understanding &quot;Hello World&quot;</title><content type='html'>&lt;iframe style=&quot;height:272px;width:480px&quot; src=&quot;http://channel9.msdn.com/Events/BUILD/BUILD2011/PLAT-875T/player?w=480&amp;amp;h=272&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;The Windows Runtime is a key piece of technology used by all Metro style apps in Windows. How exactly does it work though? You too can become a Windows Runtime Expert by taking a deep dive into the internals of the Windows Runtime using not much more than a new project in Visual Studio and a debugger. After this talk, you will understand how A &quot;Hello World&quot; Metro style app uses the Windows Runtime, enabling you to build better apps.</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/8505789552380709619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/windows-runtime-internals-understanding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8505789552380709619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8505789552380709619'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/windows-runtime-internals-understanding.html' title='Windows Runtime internals: understanding &quot;Hello World&quot;'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-8988858825309699882</id><published>2011-09-18T09:32:00.001-07:00</published><updated>2011-09-18T09:35:39.407-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Virtual Function and Virtual Destructor</title><content type='html'>Consider the case: There is a base class BASE, and a derived class DERIVED. Both have a member function getInfo(). It&#39;s a array of pointer to BASE object. Because object of DERIVED &quot;is a&quot; BASE object also, so it can be pointed by the array.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;When we call the getInfo() function of DERIVED object pointed by a pointer to BASE, which function will be called? BASE::getInfo()? or DERIVED::getInfo()? - The answer is BASE::getInfo()!&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;It&#39;s also happen on the destructor, when we delete a DERIVED object pointed by a pointer to BASE, the destructor of BASE will be called.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;It&#39;s called static binding.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class BASE{&lt;br /&gt;    public:&lt;br /&gt;        BASE(int x, int y, int z);&lt;br /&gt;        ~BASE();&lt;br /&gt;        void getInfo();&lt;br /&gt;        int a;&lt;br /&gt;    protected:&lt;br /&gt;        int b;&lt;br /&gt;        string Im;&lt;br /&gt;    private:&lt;br /&gt;        int c;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BASE::BASE(int x, int y, int z)&lt;br /&gt;:a(x), b(y), c(z){&lt;br /&gt;    Im = &quot;Base Class&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;BASE::~BASE(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE&#39;s destructor! &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void BASE::getInfo(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE::getInfo()&quot; &amp;lt;&amp;lt; &quot; : &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class DERIVED:public BASE{&lt;br /&gt;     public:&lt;br /&gt;        DERIVED(int x, int y, int z, int w);&lt;br /&gt;        ~DERIVED();&lt;br /&gt;        void getInfo();&lt;br /&gt;    private:&lt;br /&gt;        int d;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;DERIVED::DERIVED(int x, int y, int z, int w)&lt;br /&gt;:BASE(x, y, z), d(w){&lt;br /&gt;    Im = &quot;Derived Class&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;DERIVED::~DERIVED(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED&#39;s destructor! &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void DERIVED::getInfo(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED::getInfo()&quot; &amp;lt;&amp;lt; &quot; : &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    BASE* base[2];&lt;br /&gt;    base[0] = new BASE(1, 2, 3);&lt;br /&gt;    base[1] = new DERIVED(4, 5, 6, 7);&lt;br /&gt;    base[0]-&amp;gt;getInfo();&lt;br /&gt;    base[1]-&amp;gt;getInfo();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;delete base[0]&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    delete base[0];&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;delete base[1]&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    delete base[1];&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbhHtgVfUqsOmk6qWlD8wDJTk3NdDnmzeSnMWe8mPRnvdDdQq1aMJTLx7Xp6yNAitYz8P_mukPNPeqs7LmldpIoRM0X_MibRRGjODfjsAgIgpoiXVdVFDU-5fl45Hy5dUa0o9mRJiSaYI/s1600/static+binding.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbhHtgVfUqsOmk6qWlD8wDJTk3NdDnmzeSnMWe8mPRnvdDdQq1aMJTLx7Xp6yNAitYz8P_mukPNPeqs7LmldpIoRM0X_MibRRGjODfjsAgIgpoiXVdVFDU-5fl45Hy5dUa0o9mRJiSaYI/s400/static+binding.png&quot; border=&quot;0&quot; alt=&quot;static binding&quot; title=&quot;static binding&quot; id=&quot;BLOGGER_PHOTO_ID_5653738860719761458&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;To solve this problem, we can define both the getInfo() and destructor as virtual, to specify dynamic binding on the functions.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class BASE{&lt;br /&gt;    public:&lt;br /&gt;        BASE(int x, int y, int z);&lt;br /&gt;        virtual ~BASE();&lt;br /&gt;        virtual void getInfo();&lt;br /&gt;        int a;&lt;br /&gt;    protected:&lt;br /&gt;        int b;&lt;br /&gt;        string Im;&lt;br /&gt;    private:&lt;br /&gt;        int c;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BASE::BASE(int x, int y, int z)&lt;br /&gt;:a(x), b(y), c(z){&lt;br /&gt;    Im = &quot;Base Class&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;BASE::~BASE(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE&#39;s destructor! &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void BASE::getInfo(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE::getInfo()&quot; &amp;lt;&amp;lt; &quot; : &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class DERIVED:public BASE{&lt;br /&gt;     public:&lt;br /&gt;        DERIVED(int x, int y, int z, int w);&lt;br /&gt;        virtual ~DERIVED();&lt;br /&gt;        virtual void getInfo();&lt;br /&gt;    private:&lt;br /&gt;        int d;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;DERIVED::DERIVED(int x, int y, int z, int w)&lt;br /&gt;:BASE(x, y, z), d(w){&lt;br /&gt;    Im = &quot;Derived Class&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;DERIVED::~DERIVED(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED&#39;s destructor! &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void DERIVED::getInfo(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED::getInfo()&quot; &amp;lt;&amp;lt; &quot; : &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    BASE* base[2];&lt;br /&gt;    base[0] = new BASE(1, 2, 3);&lt;br /&gt;    base[1] = new DERIVED(4, 5, 6, 7);&lt;br /&gt;    base[0]-&amp;gt;getInfo();&lt;br /&gt;    base[1]-&amp;gt;getInfo();&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;delete base[0]&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    delete base[0];&lt;br /&gt;    cout &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;delete base[1]&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    delete base[1];&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2WalRuLziEkgEG-MhIXSlxim0z5ibCMnym9cuCq948mkfz-fMq10_M-VVB4H8v3dPCNL9lrT3xBCAb1Eq6r-75knZ0baRmKEVBhz5NQacJB9Fl0vZXQ9VAuD9zBFGLsJXeQm4_4ZeYFQ/s1600/dynamic+binding.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2WalRuLziEkgEG-MhIXSlxim0z5ibCMnym9cuCq948mkfz-fMq10_M-VVB4H8v3dPCNL9lrT3xBCAb1Eq6r-75knZ0baRmKEVBhz5NQacJB9Fl0vZXQ9VAuD9zBFGLsJXeQm4_4ZeYFQ/s400/dynamic+binding.png&quot; border=&quot;0&quot; alt=&quot;dynamic binding&quot; title=&quot;dynamic binding&quot; id=&quot;BLOGGER_PHOTO_ID_5653738516784757362&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/8988858825309699882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/virtual-function-and-virtual-destructor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8988858825309699882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8988858825309699882'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/virtual-function-and-virtual-destructor.html' title='Virtual Function and Virtual Destructor'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbhHtgVfUqsOmk6qWlD8wDJTk3NdDnmzeSnMWe8mPRnvdDdQq1aMJTLx7Xp6yNAitYz8P_mukPNPeqs7LmldpIoRM0X_MibRRGjODfjsAgIgpoiXVdVFDU-5fl45Hy5dUa0o9mRJiSaYI/s72-c/static+binding.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-4083670263700081458</id><published>2011-09-18T07:08:00.000-07:00</published><updated>2011-10-03T15:18:02.459-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><title type='text'>Writing modern C++ code - How C++ has evolved over the years</title><content type='html'>&lt;iframe style=&quot;height:272px;width:480px&quot; src=&quot;http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-835T/player?w=480&amp;amp;h=272&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;In this talk, Microsoft&#39;s C++ architect and chair of the ISO C++ standards committee Herb Sutter will showcase upcoming innovations in Visual C++ that show the Windows Runtime as a core part of native development. Windows 8 comes packed with rich APIs that are all Windows Runtime based, and C++ continues to deliver the tools you need to achieve the power and performance you have come to expect. Join us for a technical session that will serve as an overview of the new C++ programming model for the Windows Runtime and a prerequisite to other C++ sessions.</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/4083670263700081458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/writing-modern-c-code-how-c-has-evolved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/4083670263700081458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/4083670263700081458'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/writing-modern-c-code-how-c-has-evolved.html' title='Writing modern C++ code - How C++ has evolved over the years'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-643116845393054358</id><published>2011-09-18T06:49:00.000-07:00</published><updated>2011-10-03T15:18:08.632-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Download Microsoft® Visual Studio® 11 Developer Preview</title><content type='html'>Visual Studio 11 Developer Preview is an integrated development environment that seamlessly spans the entire life cycle of software creation, including architecture, user interface design, code creation, code insight and analysis, code deployment, testing, and validation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio 11 Developer Preview is an integrated development environment that seamlessly spans the entire life cycle of software creation, including architecture, user interface design, code creation, code insight and analysis, code deployment, testing, and validation. This release adds support for the most advanced Microsoft platforms, including the next version of Windows (code-named &quot;Windows 8&quot;) and Windows Azure, and enables you to target platforms across devices, services, and the cloud. Integration with Team Foundation Server allows the entire team, from the customer to the developer, to build scalable and high-quality applications to exacting standards and requirements.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio 11 Developer Preview is prerelease software and should not be used in production scenarios.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This preview can be installed to run side by side with an existing Visual Studio 2010 installation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: This prerelease software will expire on June 30, 2012. To continue using Visual Studio 11 after that date, you will have to install a later version of the software.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Link: - &lt;a href=&quot;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=27543&quot;&gt;Microsoft Download Center: Microsoft® Visual Studio® 11 Developer Preview (Web Installer)&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/643116845393054358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/download-microsoft-visual-studio-11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/643116845393054358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/643116845393054358'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/download-microsoft-visual-studio-11.html' title='Download Microsoft® Visual Studio® 11 Developer Preview'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-8797645050064211379</id><published>2011-09-17T14:33:00.001-07:00</published><updated>2011-09-17T14:35:11.238-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Constructor and Destructor of derived Class</title><content type='html'>Example of Constructor and Destructor of derived Class:&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class BASE{&lt;br /&gt;    public:&lt;br /&gt;        BASE(int x, int y, int z);&lt;br /&gt;        ~BASE();&lt;br /&gt;        void doit();&lt;br /&gt;        int a;&lt;br /&gt;    protected:&lt;br /&gt;        int b;&lt;br /&gt;        string Im;&lt;br /&gt;    private:&lt;br /&gt;        int c;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BASE::BASE(int x, int y, int z)&lt;br /&gt;:a(x), b(y), c(z){&lt;br /&gt;    Im = &quot;Base Class&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;BASE::~BASE(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE&#39;s destructor! &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void BASE::doit(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE::doit()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; a &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; b &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; c &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class DERIVED:public BASE{&lt;br /&gt;     public:&lt;br /&gt;        DERIVED(int x, int y, int z, int w);&lt;br /&gt;        ~DERIVED();&lt;br /&gt;        void doit();&lt;br /&gt;    private:&lt;br /&gt;        int d;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;DERIVED::DERIVED(int x, int y, int z, int w)&lt;br /&gt;:BASE(x, y, z), d(w){&lt;br /&gt;    Im = &quot;Derived Class&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;DERIVED::~DERIVED(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED&#39;s destructor! &quot; &amp;lt;&amp;lt; Im &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void DERIVED::doit(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED::doit()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    BASE::doit();&lt;br /&gt;    cout &amp;lt;&amp;lt; d &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    BASE base(1, 2, 3);&lt;br /&gt;    base.doit();&lt;br /&gt;    DERIVED derived(4, 5, 6, 7);&lt;br /&gt;    derived.doit();&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxSHDODXjXYPnwzmB3AxsC8AmiAxrqX6VgJ0dVBUeeiCcXtMEQ2vcqm0GdDPEq2cNs6Bm5UOktzY1RkennO9u8AQ-NcCh0-B8quhP5GXLTSnK4gDPvlAVuVh4go-qQWw1D4ZeDDiUhso/s1600/Derived+Class.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxSHDODXjXYPnwzmB3AxsC8AmiAxrqX6VgJ0dVBUeeiCcXtMEQ2vcqm0GdDPEq2cNs6Bm5UOktzY1RkennO9u8AQ-NcCh0-B8quhP5GXLTSnK4gDPvlAVuVh4go-qQWw1D4ZeDDiUhso/s400/Derived+Class.png&quot; border=&quot;0&quot; alt=&quot;Constructor and Destructor of derived Class&quot; title=&quot;Constructor and Destructor of derived Class&quot; id=&quot;BLOGGER_PHOTO_ID_5653445098642212402&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/8797645050064211379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/constructor-and-destructor-of-derived.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8797645050064211379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/8797645050064211379'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/constructor-and-destructor-of-derived.html' title='Constructor and Destructor of derived Class'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxSHDODXjXYPnwzmB3AxsC8AmiAxrqX6VgJ0dVBUeeiCcXtMEQ2vcqm0GdDPEq2cNs6Bm5UOktzY1RkennO9u8AQ-NcCh0-B8quhP5GXLTSnK4gDPvlAVuVh4go-qQWw1D4ZeDDiUhso/s72-c/Derived+Class.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-541065128023706683</id><published>2011-09-17T13:59:00.001-07:00</published><updated>2011-09-17T13:59:30.345-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Derived class cannot access private area of base class</title><content type='html'>example:&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class BASE{&lt;br /&gt;    public:&lt;br /&gt;        void doit();&lt;br /&gt;        int a;&lt;br /&gt;    protected:&lt;br /&gt;        int b;&lt;br /&gt;    private:&lt;br /&gt;        int c;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class DERIVED:public BASE{&lt;br /&gt;     public:&lt;br /&gt;        void doit();&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void BASE::doit(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;BASE::doit()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; a &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; b &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; c &amp;lt;&amp;lt; endl;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void DERIVED::doit(){&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;DERIVED::doit()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    BASE::doit();&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;---&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; a &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; b &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; c &amp;lt;&amp;lt; endl;  //ERROR: cannot access private of base class&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    BASE base;&lt;br /&gt;    base.doit();&lt;br /&gt;    DERIVED derived;&lt;br /&gt;    derived.doit();&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/541065128023706683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/derived-class-cannot-access-private.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/541065128023706683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/541065128023706683'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/derived-class-cannot-access-private.html' title='Derived class cannot access private area of base class'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-2807441451769813243</id><published>2011-09-17T12:10:00.001-07:00</published><updated>2011-09-17T12:11:49.434-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>Some function examples of STD string</title><content type='html'>example:&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;string std_string;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;STD String Test&quot; &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; endl;&lt;br /&gt;&lt;br /&gt;    std_string = &quot;We wish you a merry Christmas and a Happy New Year!&quot;;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;std_string = &quot; &amp;lt;&amp;lt; std_string &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;std_string.find(\&quot;Christmas\&quot;) = &quot; &amp;lt;&amp;lt; std_string.find(&quot;Christmas&quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;std_string.substr(20, 9) = &quot; &amp;lt;&amp;lt; std_string.substr(20, 9) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;std_string.insert(20, \&quot;2011\&quot;) = &quot; &amp;lt;&amp;lt; std_string.insert(20, &quot;2011 &quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;std_string.erase(20, 5) = &quot; &amp;lt;&amp;lt; std_string.erase(20, 5) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &quot;std_string.replace(20, 6, \&quot;X&#39;\&quot;) = &quot; &amp;lt;&amp;lt; std_string.replace(20, 6, &quot;X&#39;&quot;) &amp;lt;&amp;lt; endl;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqCiRaRX-dukpHIVBBZpNUj0ldICqj3k2nu3ZNLL_NcoqRAdWy1qIqb5gh7DeL-a6pdi7PEWIAAcC22Qs6ZDDXaZFNuC8YQT2ISakpSuf3-W6OP_li00IKKs_vaGqf5skjL_Jxguu1px4/s1600/STRstring.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqCiRaRX-dukpHIVBBZpNUj0ldICqj3k2nu3ZNLL_NcoqRAdWy1qIqb5gh7DeL-a6pdi7PEWIAAcC22Qs6ZDDXaZFNuC8YQT2ISakpSuf3-W6OP_li00IKKs_vaGqf5skjL_Jxguu1px4/s400/STRstring.png&quot; border=&quot;0&quot; alt=&quot;Some function examples of STD string&quot; title=&quot;Some function examples of STD string&quot; id=&quot;BLOGGER_PHOTO_ID_5653408180652994978&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/2807441451769813243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/some-function-examples-of-std-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/2807441451769813243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/2807441451769813243'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/some-function-examples-of-std-string.html' title='Some function examples of STD string'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqCiRaRX-dukpHIVBBZpNUj0ldICqj3k2nu3ZNLL_NcoqRAdWy1qIqb5gh7DeL-a6pdi7PEWIAAcC22Qs6ZDDXaZFNuC8YQT2ISakpSuf3-W6OP_li00IKKs_vaGqf5skjL_Jxguu1px4/s72-c/STRstring.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3950643458726157057.post-7697712796775673170</id><published>2011-09-17T11:31:00.001-07:00</published><updated>2011-09-17T11:32:46.394-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><title type='text'>friend class</title><content type='html'>In definded friend class, it can access private data.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;example:&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class MyClass{&lt;br /&gt;  public:&lt;br /&gt;      MyClass(const int mSize);&lt;br /&gt;      MyClass(MyClass&amp;amp; src);&lt;br /&gt;      ~MyClass();&lt;br /&gt;      void fill(char c);&lt;br /&gt;      void getInfo();&lt;br /&gt;      MyClass&amp;amp; operator=(const MyClass&amp;amp; src);&lt;br /&gt;  private:&lt;br /&gt;      int size;&lt;br /&gt;      char* ptToChar;&lt;br /&gt;&lt;br /&gt;      friend class MyFriend;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;//Constructor with default size&lt;br /&gt;MyClass::MyClass(const int mSize = 10)&lt;br /&gt;{&lt;br /&gt;  size = mSize;&lt;br /&gt;  ptToChar = new char[size];&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Copy Constructor&lt;br /&gt;MyClass::MyClass(MyClass&amp;amp; src){&lt;br /&gt;  size = src.size;&lt;br /&gt;  ptToChar = new char[size];&lt;br /&gt;  for(int i = 0; i &amp;lt; size; i++)&lt;br /&gt;      ptToChar[i] = src.ptToChar[i];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;MyClass::~MyClass(){&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;MyClass Destructor: &quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void MyClass::fill(char c){&lt;br /&gt;  for(int i = 0; i &amp;lt; size; i++)&lt;br /&gt;      ptToChar[i] = c;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void MyClass::getInfo()&lt;br /&gt;{&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;size: &quot; &amp;lt;&amp;lt; size &amp;lt;&amp;lt; endl;&lt;br /&gt;  for(int i = 0; i &amp;lt; size; i++)&lt;br /&gt;      cout &amp;lt;&amp;lt; ptToChar[i];&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Overload operator =&lt;br /&gt;MyClass&amp;amp; MyClass::operator=(const MyClass&amp;amp; src){&lt;br /&gt;  if (this != &amp;amp;src){&lt;br /&gt;      delete[] ptToChar;&lt;br /&gt;&lt;br /&gt;      size = src.size;&lt;br /&gt;      ptToChar = new char[size];&lt;br /&gt;      for(int i = 0; i &amp;lt; size; i++)&lt;br /&gt;      ptToChar[i] = src.ptToChar[i];&lt;br /&gt;  }&lt;br /&gt;  return *this;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class MyFriend{&lt;br /&gt;  public:&lt;br /&gt;      void getFriendInfo(const MyClass&amp;amp; myfriend);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void MyFriend::getFriendInfo(const MyClass&amp;amp; myfriend){&lt;br /&gt;  cout &amp;lt;&amp;lt; &quot;size: &quot; &amp;lt;&amp;lt; myfriend.size &amp;lt;&amp;lt; endl;&lt;br /&gt;  for(int i = 0; i &amp;lt; myfriend.size; i++)&lt;br /&gt;      cout &amp;lt;&amp;lt; myfriend.ptToChar[i];&lt;br /&gt;  cout &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;  MyClass myClass1(20);&lt;br /&gt;  myClass1.fill(&#39;A&#39;);&lt;br /&gt;  myClass1.getInfo();&lt;br /&gt;&lt;br /&gt;  MyClass myClass2(10);&lt;br /&gt;  myClass2 = myClass1;&lt;br /&gt;&lt;br /&gt;  myClass2.getInfo();&lt;br /&gt;&lt;br /&gt;  myClass1.fill(&#39;B&#39;);&lt;br /&gt;  myClass1.getInfo();&lt;br /&gt;  myClass2.getInfo();&lt;br /&gt;&lt;br /&gt;  cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; &quot;Create MyFriend friendA()&quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;  MyFriend friendA;&lt;br /&gt;  friendA.getFriendInfo(myClass1);&lt;br /&gt;  friendA.getFriendInfo(myClass2);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitMZw2CPPNXBSwfSMMNfT62p4zodDgJzmDk1VeEVqGsCm8upDbxnMGb2BlZnkk1OkxxrfQktVIqCy4J43VIAC1TYAw7_K7-tXPFfBEJMTzLDUkCUb1LeyH9_Y42AjXijL4CuMuARk4G7A/s1600/friend+class.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 285px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitMZw2CPPNXBSwfSMMNfT62p4zodDgJzmDk1VeEVqGsCm8upDbxnMGb2BlZnkk1OkxxrfQktVIqCy4J43VIAC1TYAw7_K7-tXPFfBEJMTzLDUkCUb1LeyH9_Y42AjXijL4CuMuARk4G7A/s400/friend+class.png&quot; border=&quot;0&quot; alt=&quot;friend class&quot; title=&quot;friend class&quot; id=&quot;BLOGGER_PHOTO_ID_5653398095178197586&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-exercise.blogspot.com/feeds/7697712796775673170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-exercise.blogspot.com/2011/09/friend-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/7697712796775673170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3950643458726157057/posts/default/7697712796775673170'/><link rel='alternate' type='text/html' href='http://c-exercise.blogspot.com/2011/09/friend-class.html' title='friend class'/><author><name>c.exercise</name><uri>http://www.blogger.com/profile/00686497009818165862</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBNyx-b3xCA3J2NtNeb83jLjPeIWnG9872GIpmv81kbtDYHLkhs9BUTTB3ng3HCTVAYZpt9SPkzwmlg2vvoWf3FndRx84J4w-3Bi4NJB2kUSOEGUjljKGjnoEfR66WK6I/s220/exercise.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitMZw2CPPNXBSwfSMMNfT62p4zodDgJzmDk1VeEVqGsCm8upDbxnMGb2BlZnkk1OkxxrfQktVIqCy4J43VIAC1TYAw7_K7-tXPFfBEJMTzLDUkCUb1LeyH9_Y42AjXijL4CuMuARk4G7A/s72-c/friend+class.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>