<?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: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-2296207394520697058</id><updated>2011-07-28T19:27:35.876-04:00</updated><title type='text'>My OOP344 Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3812581967400125188</id><published>2010-09-14T22:09:00.001-04:00</published><updated>2010-09-14T22:10:53.557-04:00</updated><title type='text'>A Good 'typedef' reference</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Typedef"&gt;http://en.wikipedia.org/wiki/Typedef&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3812581967400125188?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3812581967400125188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/09/typedef.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3812581967400125188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3812581967400125188'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/09/typedef.html' title='A Good &apos;typedef&apos; reference'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3197217169343220969</id><published>2010-08-21T23:25:00.002-04:00</published><updated>2010-08-21T23:30:57.429-04:00</updated><title type='text'>Review OOP344</title><content type='html'>extern "C"{&lt;br /&gt;   include"hello.h"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The pre-processor substitutes each macro        citation with the replacement text.  The pre-processor        recognizes&lt;span style="color: rgb(255, 0, 0);"&gt; three types of macros&lt;/span&gt;:         &lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;object-like&lt;/span&gt; macros&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;function-like&lt;/span&gt; macros&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;predefined&lt;/span&gt; macros&lt;/li&gt;&lt;/ul&gt;Efficiency and Flexibility         &lt;p&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Function-like macros &lt;/span&gt;provide efficient and flexible        solutions.  They avoid the overhead of        function calls and do not impose type constraints on the        parameters in the macro definition.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3197217169343220969?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3197217169343220969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/08/review-oop344.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3197217169343220969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3197217169343220969'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/08/review-oop344.html' title='Review OOP344'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-8187968237449082053</id><published>2010-07-26T09:42:00.003-04:00</published><updated>2010-07-26T17:54:40.810-04:00</updated><title type='text'>Revew OOP244 - Derived Class</title><content type='html'>The subject of an "&lt;span class="code"&gt;is-a-kind-of&lt;/span&gt;" relationship is the &lt;span class="code"&gt;derived&lt;/span&gt; class.  The object is the        &lt;span class="code"&gt;base&lt;/span&gt; class.&lt;br /&gt;&lt;br /&gt;Little notes&lt;br /&gt;&lt;pre&gt;student.&lt;span class="high"&gt;Person::display();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Derived Class with resource copy constructor, please refer &lt;a href="https://cs.senecac.on.ca/%7Ebtp200/pages/content/dclas.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-8187968237449082053?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/8187968237449082053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-derived-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8187968237449082053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8187968237449082053'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-derived-class.html' title='Revew OOP244 - Derived Class'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-7122299651470593558</id><published>2010-07-26T08:43:00.002-04:00</published><updated>2010-07-26T08:55:51.904-04:00</updated><title type='text'>Revew OOP244 - Conversion Operators</title><content type='html'>The form of a conversion operator declaration is        &lt;pre style="font-family: georgia;" class="defin"&gt; operator dataType() const;&lt;br /&gt;&lt;span class="high"&gt;&lt;br /&gt;example: operator int() const;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In our case, the compiler fails to find an exact, promoted,&lt;br /&gt;      or standard-conversion match for any argument-parameter pair,&lt;br /&gt;      and searches the single argument constructors for a derived data&lt;br /&gt;      type conversion match.  The compiler inserts the&lt;br /&gt;      constructor code to convert &lt;span class="code"&gt;1234&lt;/span&gt; to a&lt;br /&gt;      &lt;span class="code"&gt;Student&lt;/span&gt; and then calls the assignment&lt;br /&gt;      operator that receives a &lt;span class="code"&gt;Student&lt;/span&gt; as&lt;br /&gt;      its right operand.  That is,&lt;br /&gt;harry = 1234; // calls operator=(const Student&amp;amp; Student(1234))&lt;br /&gt;      &lt;/pre&gt;If the &lt;span class="code"&gt;Student(int)&lt;/span&gt;        constructor were absent, the compiler could not convert        &lt;span class="code"&gt;1234&lt;/span&gt; to a &lt;span class="code"&gt;Student&lt;/span&gt; and would reject the assignment        expression.  However, if our class declaration had a        &lt;span class="code"&gt;Student(long long)&lt;/span&gt; constructor, the        compiler could convert &lt;span class="code"&gt;1234&lt;/span&gt; to        &lt;span class="code"&gt;1234LL&lt;/span&gt;, then convert &lt;span class="code"&gt;1234LL&lt;/span&gt; to a &lt;span class="code"&gt;Student&lt;/span&gt; data        type, and finally assign the right &lt;span class="code"&gt;Student&lt;/span&gt; operand to the left &lt;span class="code"&gt;Student&lt;/span&gt; operand.        &lt;pre class="defin"&gt;&lt;br /&gt;To comprehend above please refer more &lt;a href="https://cs.senecac.on.ca/%7Ebtp200/pages/content/conve.html"&gt;detail&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-7122299651470593558?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/7122299651470593558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-conversion-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7122299651470593558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7122299651470593558'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-conversion-operators.html' title='Revew OOP244 - Conversion Operators'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3514234343818146049</id><published>2010-07-26T08:29:00.000-04:00</published><updated>2010-07-26T08:30:05.634-04:00</updated><title type='text'>Revew OOP244 - Custom iostream Operators</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3514234343818146049?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3514234343818146049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-custom-iostream-operators.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3514234343818146049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3514234343818146049'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-custom-iostream-operators.html' title='Revew OOP244 - Custom iostream Operators'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-8175882442863721442</id><published>2010-07-26T08:08:00.002-04:00</published><updated>2010-07-26T08:24:06.497-04:00</updated><title type='text'>Revew OOP244 - deep copy</title><content type='html'>In object-oriented programming, an object is not limited        to the information stored in its own memory.  An object can        also access resources.  A resource is information that        is available to the object but is stored outside the object.         The structure of such objects is described by &lt;em&gt;classes with        resources&lt;/em&gt;.&lt;br /&gt;&lt;p id="sym" class="section"&gt;Resources&lt;/p&gt;         &lt;p&gt;Resources include dynamic memory and files.  These        collections of information contain data that is stored        outside the memory allocated to an object.  An object        keeps track of its resources through instance variables that        hold the addresses of the resources.  Such instance        variables include&lt;/p&gt;         &lt;ul&gt;&lt;li&gt;pointers to dynamic arrays in freestore memory&lt;/li&gt;&lt;li&gt;pointers to file structures&lt;/li&gt;&lt;li&gt;references&lt;/li&gt;&lt;/ul&gt;         We call such instance variables &lt;span class="high"&gt;resource        instance variables&lt;/span&gt;. &lt;br /&gt;&lt;br /&gt;&lt;p&gt;To enable deep copying, we overwrite the compiler defaults        for two member functions:&lt;/p&gt;         &lt;ol&gt;&lt;li&gt;the copy constructor&lt;/li&gt;&lt;li&gt;the assignment operator&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;A copy constructor declaration takes the form&lt;/p&gt;        &lt;pre class="defin"&gt; Identifier ( const Identifier&amp;amp; );&lt;br /&gt;&lt;/pre&gt;&lt;p id="ass" class="section"&gt;Assignment Operator&lt;/p&gt;         &lt;p&gt;The assignment operator is an operator that copies data from        an existing object into an &lt;span class="c2"&gt;existing&lt;/span&gt; object.         The compiler calls this operator whenever the compiler encounters        an expression of the form&lt;/p&gt;         identifier = identifier where &lt;span class="code"&gt;identifier&lt;/span&gt; is the name of an object.       &lt;p&gt;The form of an assignment operator declaration is        &lt;/p&gt; Identifier&amp;amp; operator=(const Identifier&amp;amp;);&lt;br /&gt;&lt;br /&gt;&lt;p id="noc" class="section"&gt;No Copies Allowed&lt;/p&gt;         &lt;p&gt;In certain applications, it may be wise to avoid the making        copies or assignments altogether.  To prohibit the copying        and the assigning of objects, we declare the copy constructor        and the assignment operator as private members.  For example,&lt;/p&gt;                                      &lt;br /&gt;           class Student {      int no;      char* grade;      &lt;span class="high"&gt;Student(const Student&amp;amp; source);      void operator=(const Student&amp;amp; source);&lt;/span&gt;  public:      Student();      Student(int, const char*);      ~Student();      void display() const;  };&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-8175882442863721442?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/8175882442863721442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-deep-copy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8175882442863721442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8175882442863721442'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-deep-copy.html' title='Revew OOP244 - deep copy'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-6161205072847801189</id><published>2010-07-26T08:07:00.001-04:00</published><updated>2010-07-26T08:07:23.574-04:00</updated><title type='text'>Revew OOP244 - Operator +</title><content type='html'>&lt;pre&gt; Student operator+(const Student &amp;amp;student, char grade) {&lt;br /&gt;    Student modified = student;&lt;br /&gt;    modified += grade;      // calls += operator&lt;br /&gt;    return modified;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="high"&gt;Student operator+(char grade, const Student &amp;amp;student) {&lt;br /&gt;    return student + grade; // calls operator+(const&lt;br /&gt;                            //    Student&amp;amp;, char)&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-6161205072847801189?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/6161205072847801189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6161205072847801189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6161205072847801189'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-operator.html' title='Revew OOP244 - Operator +'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3775829404301557784</id><published>2010-07-26T08:01:00.003-04:00</published><updated>2010-07-26T08:04:47.623-04:00</updated><title type='text'>Revew OOP244 - friend &amp; friend class</title><content type='html'>&lt;pre class="defin"&gt;friend type helper(...);&lt;br /&gt;in .h file&lt;br /&gt;&lt;span class="high"&gt;friend int operator==(const Student&amp;amp;, const Student&amp;amp;);&lt;/span&gt;&lt;br /&gt;in .cpp file&lt;br /&gt;&lt;span class="high"&gt;int operator==(const Student&amp;amp; lhs, const Student&amp;amp; rhs) {&lt;br /&gt;    return lhs.no == rhs.no &amp;amp;&amp;amp;&lt;br /&gt;           strcmp(lhs.grade, rhs.grade) == 0;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p class="ssection"&gt;Friend Classes (Optional)&lt;/p&gt;         &lt;p&gt;A class can grant access to its own private members to all of the        member functions of another class.  A class friendship        declaration takes the form&lt;/p&gt;         friend class Identifier;          &lt;p&gt;where &lt;span class="code"&gt;Identifier&lt;/span&gt; is the name of the        class that is to have private access privileges. &lt;/p&gt;&lt;p&gt;class student{&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;public:&lt;/p&gt;&lt;p&gt;...&lt;br /&gt;&lt;/p&gt;&lt;pre class="defin"&gt;&lt;span style="color: rgb(204, 0, 0);" class="high"&gt;friend class Administrator;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3775829404301557784?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3775829404301557784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-friend-friend-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3775829404301557784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3775829404301557784'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-friend-friend-class.html' title='Revew OOP244 - friend &amp; friend class'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-5969815555357261064</id><published>2010-07-26T07:50:00.002-04:00</published><updated>2010-07-26T07:55:13.170-04:00</updated><title type='text'>Revew OOP244 - Operators overload</title><content type='html'>&lt;p class="ssection"&gt;Candidates for Overloading&lt;/p&gt;         &lt;p&gt;We may overload the following operators (amongst        others): &lt;/p&gt;         &lt;ol&gt;&lt;li&gt;post-fix/pre-fix (&lt;span class="code"&gt;++ --&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;assignment (&lt;span class="code"&gt;= += -= *= /=         %=&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;unary arithmetic (&lt;span class="code"&gt;+ -&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;binary arithmetic (&lt;span class="code"&gt;+ - * /         %&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;relational (&lt;span class="code"&gt;== &lt; &gt; &lt;= &gt;=         !=&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;logical (&lt;span class="code"&gt;&amp;amp;&amp;amp; || !&lt;/span&gt;)&lt;/li&gt;&lt;/ol&gt;         &lt;p&gt;        We may NOT overload the following operators&lt;/p&gt;         &lt;ul&gt;&lt;li&gt;the scope resolution operator (&lt;span class="code"&gt;::&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;the member selection operator (&lt;span class="code"&gt;.&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;the member selection through pointer to member operator         (&lt;span class="code"&gt;.*&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;the ternary operator (&lt;span class="code"&gt;?:&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;the sizeof operator (&lt;span class="code"&gt;sizeof&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;the typeid operator (&lt;span class="code"&gt;type()&lt;/span&gt;)&lt;/li&gt;&lt;/ul&gt;Post-Fix Operators&lt;br /&gt;&lt;pre class="defin"&gt;Type operator++(int)  or  Type operator--(int)&lt;br /&gt;The &lt;span class="code"&gt;int&lt;/span&gt; type in the parameter list&lt;br /&gt;      distinguishes the post-fix operator from its pre-fix&lt;br /&gt;      counterpart.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt; Student Student::operator++() {&lt;br /&gt;    for (int i = 0; grade[i] != '\0'; i++)&lt;br /&gt;        if (grade[i] == 'F') grade[i] = 'D';&lt;br /&gt;        else if (grade[i] != 'A') grade[i]--;&lt;br /&gt;    return *this;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="high"&gt;Student Student::operator++(int) {&lt;br /&gt;    Student s = *this;  // save the original&lt;br /&gt;    ++(*this);          // call the pre-fix operator&lt;br /&gt;    return s;           // return the original&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-5969815555357261064?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/5969815555357261064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-operators-overload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/5969815555357261064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/5969815555357261064'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-operators-overload.html' title='Revew OOP244 - Operators overload'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3436332055098958530</id><published>2010-07-26T00:38:00.002-04:00</published><updated>2010-07-26T00:39:24.066-04:00</updated><title type='text'>Revew OOP244 - </title><content type='html'>&lt;table class="center" summary="" width="80%"&gt;&lt;tbody&gt;&lt;tr class="desc"&gt;&lt;td class="w30"&gt;&lt;strong&gt;Manipulator&lt;/strong&gt;&lt;/td&gt;           &lt;td class="w70" align="left"&gt;          &lt;strong&gt; Effect&lt;/strong&gt;&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;fixed&lt;/td&gt;           &lt;td align="left"&gt; display floats in fixed-point          format&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;scientific&lt;/td&gt;           &lt;td align="left"&gt; display floats in floating-point          format&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;left&lt;/td&gt;           &lt;td align="left"&gt; left justify&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;right&lt;/td&gt;           &lt;td align="left"&gt; right justify&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;flush&lt;/td&gt;           &lt;td align="left"&gt; flush the output buffer&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;endl&lt;/td&gt;           &lt;td align="left"&gt; send end of line and flush&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;setprecision(int)&lt;/td&gt;           &lt;td align="left"&gt; set number of digits output&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;setfill(int)&lt;/td&gt;           &lt;td align="left"&gt; set fill character&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;setbase(int)&lt;/td&gt;           &lt;td align="left"&gt; set base for &lt;span class="code"&gt;int&lt;/span&gt; output&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code"&gt;setw(int)&lt;/td&gt;           &lt;td align="left"&gt; set field width for next output          only&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3436332055098958530?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3436332055098958530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3436332055098958530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3436332055098958530'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244.html' title='Revew OOP244 - &lt;iomanip&gt;'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-1783116275239910961</id><published>2010-07-26T00:33:00.001-04:00</published><updated>2010-07-26T00:33:31.381-04:00</updated><title type='text'>call global function</title><content type='html'>&lt;pre&gt; display();   // calls member function from inside a member function&lt;br /&gt;&lt;span class="high"&gt;::&lt;/span&gt;display(); // calls global function from inside a member function&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-1783116275239910961?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/1783116275239910961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/call-global-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1783116275239910961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1783116275239910961'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/call-global-function.html' title='call global function'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-4512476154897357223</id><published>2010-07-26T00:26:00.002-04:00</published><updated>2010-07-26T00:29:29.938-04:00</updated><title type='text'>Revew OOP244 - Insufficient Memory</title><content type='html'>include &lt;new&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Student* student = NULL;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;student = new &lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);font-family:arial;" class="high" &gt;(nothrow)&lt;/span&gt;&lt;span style="font-family:arial;"&gt; Student[n];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     if (student == NULL)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         cout &lt;&lt; "Memory Allocation Failed" &lt;&lt;&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     else {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     }&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-4512476154897357223?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/4512476154897357223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-insufficient-memory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4512476154897357223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4512476154897357223'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-insufficient-memory.html' title='Revew OOP244 - Insufficient Memory'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3462992204081090229</id><published>2010-07-26T00:19:00.001-04:00</published><updated>2010-07-26T00:26:34.737-04:00</updated><title type='text'>Revew OOP244 - Dynamic Memory</title><content type='html'>A program that the operating system has loaded into primary        memory may obtain additional memory from the operating system        at run-time.  We refer to this additional memory as        dynamic memory.&lt;br /&gt;&lt;p&gt;Variables and objects stored in dynamic memory can survive        until the program terminates if necessary.  Their lifetime        only ends when the program explicitly deallocates their dynamic        memory.  Note that, unlike variables and objects in static        memory, those in dynamic memory do not go of out scope at the        closing brace of the block within which they have been defined. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3462992204081090229?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3462992204081090229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-dynamic-memory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3462992204081090229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3462992204081090229'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-dynamic-memory.html' title='Revew OOP244 - Dynamic Memory'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-1174680371309062238</id><published>2010-07-25T23:12:00.008-04:00</published><updated>2010-07-25T23:28:40.808-04:00</updated><title type='text'>Review OOP244 - Primitive types &amp; Derived Types</title><content type='html'>Both C and C++ predefine all of their primitive types.         We cannot redefine these types or introduce new primitive        types.&lt;br /&gt;int,double,float,char&lt;br /&gt;&lt;br /&gt;derived types&lt;br /&gt;struct Type{&lt;br /&gt;...&lt;br /&gt;}&lt;span style="color: rgb(255, 0, 0);font-size:180%;" &gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;span class="high"  style="font-family:arial;"&gt;struct Student {&lt;br /&gt;  int no;          // student number&lt;br /&gt;  char grade[14];  // grades&lt;br /&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;struct Student harry;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to access &lt;span class="code"&gt;harry&lt;/span&gt;'s student number, we write&lt;br /&gt;&lt;br /&gt;harry.no;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;to get address of harry's student number, we write&lt;br /&gt;&lt;br /&gt;&amp;amp;harry.no;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;//&amp;amp;harry.grade[0];&lt;/pre&gt;&lt;p&gt;We retrieve the address of a non-array member using the        address of operator (&lt;span class="code"&gt;&amp;amp;&lt;/span&gt;)&lt;/p&gt;                                     &lt;br /&gt;          &lt;span class="high"&gt;&amp;amp;&lt;/span&gt;instance.member &lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-1174680371309062238?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/1174680371309062238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/primitive-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1174680371309062238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1174680371309062238'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/primitive-types.html' title='Review OOP244 - Primitive types &amp; Derived Types'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-7269405788643562612</id><published>2010-07-25T22:09:00.010-04:00</published><updated>2010-07-25T22:26:27.342-04:00</updated><title type='text'>Revew OOP244 - Array and Pointer</title><content type='html'>y=NULL;&lt;br /&gt;cout &lt; &lt;y; 0=""&gt;&lt; y;     output is 0  double* address= NULL; y=*address; cout&lt; &lt; y;  output is segementation fault &lt;br /&gt;&lt;br /&gt;Tips on char* and char array&lt;br /&gt;&lt;/y;&gt;&lt;pre&gt; char str[] = "This is OOP244";&lt;br /&gt;char* s;&lt;br /&gt;&lt;br /&gt;s = &amp;amp;str[8];              // points to the first 'O' in OOP244&lt;br /&gt;cout &lt;&lt; *(s + 3) &lt;&lt; endl; // displays 244&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-7269405788643562612?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/7269405788643562612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-array-and-pointer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7269405788643562612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7269405788643562612'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/revew-oop244-array-and-pointer.html' title='Revew OOP244 - Array and Pointer'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-1060551995687492870</id><published>2010-07-25T21:50:00.005-04:00</published><updated>2010-07-25T22:01:21.413-04:00</updated><title type='text'>Review OOP244   -  Modular Programs</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="font-family: arial;"&gt;3 concepts applies to designing classes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Encapsulation, Inheritance, Polymorphism&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What Does Compiler Do?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;the pre-processor inserts the contents of the header files         into the implementation file for each module and substitutes         all &lt;span class="code"&gt;#define&lt;/span&gt; strings to create a single         source file ready for compilation&lt;/li&gt;&lt;li&gt;the compiler properly compiles each pre-processed source         file and create a binary file&lt;/li&gt;&lt;li&gt;the linker assembles the binary files for the application         with the library binary files to form a single executable file&lt;/li&gt;&lt;/ol&gt;Summary&lt;br /&gt;&lt;ul&gt;&lt;li&gt;an application may be divided into a number of independent         components: these components are called modules&lt;/li&gt;&lt;li&gt;a different module can be defined for each class in an         application due to the encapsulated nature of the class&lt;/li&gt;&lt;li&gt;preparation of an executable file entails three separate         stages: pre-processing, compilation and linking&lt;/li&gt;&lt;li&gt;each module consists of a header file and an implementation         file and is pre-processed and compiled independently&lt;/li&gt;&lt;li&gt;a module's header file contains the declarations of the         module's names without definitions or any executable statements&lt;/li&gt;&lt;li&gt;a module's implementation file contains the definitions         of the module's functions&lt;/li&gt;&lt;li&gt;for compilation, a module's implementation file only         needs to include the header files of those modules that         contain declarations of the names referred to in the         implementation file itself&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-1060551995687492870?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/1060551995687492870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/review-oop244-modular-programs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1060551995687492870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1060551995687492870'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/review-oop244-modular-programs.html' title='Review OOP244   -  Modular Programs'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-7795671101444345316</id><published>2010-07-25T12:20:00.001-04:00</published><updated>2010-07-26T07:59:02.101-04:00</updated><title type='text'>swap is a common function name which be used in basic libraries</title><content type='html'>try to avoid use it "swap" as function name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-7795671101444345316?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/7795671101444345316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/swap-is-common-function-name-used-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7795671101444345316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7795671101444345316'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/swap-is-common-function-name-used-in.html' title='swap is a common function name which be used in basic libraries'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-6760290758335138685</id><published>2010-07-25T11:11:00.002-04:00</published><updated>2010-07-25T12:20:02.675-04:00</updated><title type='text'>New Style Casts</title><content type='html'>&lt;p class="ssection"&gt;New Style Casts&lt;/p&gt;         &lt;p&gt;The new style casts are both more specific and much easier to        spot.  Their syntax includes the letters &lt;span class="code"&gt;_cast&lt;/span&gt;, which makes searching more        straightforward.  The casts are in template function form,        where the variable or object to be cast is passed as the        function argument and the destination type is passed as the        template argument.  There are four distinct categories of        casts:&lt;/p&gt;         &lt;ul&gt;&lt;li&gt;static cast                       &lt;br /&gt;&lt;pre&gt;&lt;span class="high"&gt;static_cast&lt;double&gt;&lt;/span&gt;( minutes )&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;const cast&lt;pre&gt;&lt;span class="high"&gt;const_cast&lt;polygon*&gt;&lt;/span&gt;(&amp;amp;p)(Polygon is a class here)&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;re-interpret cast&lt;/li&gt;&lt;li&gt;&lt;p class="sssection"&gt;Re-Interpret Cast&lt;/p&gt;         &lt;p&gt;A re-interpret cast converts a value between unrelated data        types such asinteger to pointer type, pointer to unrelated pointer type&lt;/p&gt;         &lt;/li&gt;&lt;/ul&gt;         &lt;p&gt;For example,&lt;/p&gt;                                      &lt;br /&gt;          &lt;pre&gt; // Re-Interpret Cast&lt;br /&gt;// reinterpret.cpp&lt;br /&gt;// Nov 21 2005&lt;br /&gt;&lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main( ) {&lt;br /&gt;    int* p;&lt;br /&gt;    int x = 0x00ff00;&lt;br /&gt;&lt;br /&gt;    p = &lt;span class="high"&gt;reinterpret_cast&lt;int*&gt;&lt;/span&gt;( x );  // New Style Cast&lt;br /&gt;    cout &lt;&lt; hex &lt;&lt; p &lt;&lt; endl;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;dynamic cast&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-6760290758335138685?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/6760290758335138685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/new-style-casts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6760290758335138685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6760290758335138685'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/new-style-casts.html' title='New Style Casts'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-1096460934953992664</id><published>2010-07-24T21:28:00.001-04:00</published><updated>2010-07-24T21:28:46.397-04:00</updated><title type='text'>shortcut to compile on matrix</title><content type='html'>To compile in matrix, use: g++ yada.cpp yadoo.cpp -x c iof.c -lncurses If you have many cpp's, you may also do g++ *.cpp -x c iof.c -lncurses&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-1096460934953992664?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/1096460934953992664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/shortcut-to-compile-on-matrix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1096460934953992664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1096460934953992664'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/shortcut-to-compile-on-matrix.html' title='shortcut to compile on matrix'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-588806329168176579</id><published>2010-07-24T19:18:00.003-04:00</published><updated>2010-07-24T19:23:41.624-04:00</updated><title type='text'>keywords throw / try /catch and example of their usage</title><content type='html'>&lt;pre  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt; void divide(int a[], int i, int n, int divisor) {&lt;br /&gt; if(i &lt;&gt;= n)&lt;br /&gt;    &lt;span style="color: rgb(204, 0, 0);"&gt; &lt;/span&gt;&lt;span class="high"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;throw&lt;/span&gt; "Outside array bounds";&lt;/span&gt;&lt;br /&gt; else if(divisor == 0)&lt;br /&gt;    &lt;span style="color: rgb(204, 0, 0);"&gt; &lt;/span&gt;&lt;span class="high"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;throw&lt;/span&gt; divisor;&lt;/span&gt;&lt;br /&gt; else&lt;br /&gt;     a[i] = i / divisor;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt; bool keepgoing = true;&lt;br /&gt; int a[MAX] = {1,2,3,4,5,6,7,8,9,10}, index,&lt;br /&gt;     divisor;&lt;br /&gt;&lt;br /&gt; do {&lt;br /&gt;     &lt;span class="high"&gt;try {&lt;/span&gt;&lt;br /&gt;         cout &lt;&lt; "Index: ";             cin &gt;&gt; index;&lt;br /&gt;         cout &lt;&lt; "Divisor: ";             cin &gt;&gt; divisor;&lt;br /&gt;         divide(a, index, MAX, divisor);&lt;br /&gt;         cout &lt;&lt; "a[index] = " &lt;&lt; class="high"&gt;} &lt;span style="color: rgb(153, 0, 0);"&gt;catch(const char* msg)&lt;/span&gt; {&lt;/span&gt;&lt;br /&gt;         cout &lt;&lt; keepgoing =" false;" class="high"&gt;}&lt;span style="color: rgb(153, 0, 0);"&gt; catch(int value)&lt;/span&gt; {&lt;br /&gt;         cout &lt;&lt; "Zero divisor" &lt;&lt; class="high"&gt;}&lt;br /&gt; } while (keepgoing);&lt;br /&gt;&lt;br /&gt; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;       All of the code within the &lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);" class="code"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;       block is executed repeatedly unless an exception is thrown by&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;       any of the statements within the block.  If an exception is&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;       thrown, any remaining code within the &lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);" class="code"&gt;try&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; block is skipped and the code in the first&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;       &lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);" class="code"&gt;catch&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; block that receives a type&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;       matching the type of the thrown exception is executed. &lt;span style="color: rgb(153, 51, 0);"&gt; If&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;       an exception is thrown and no match is found at any point in the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;       program, the program calls &lt;/span&gt;&lt;span style="color: rgb(153, 51, 0);" class="code"&gt;std::terminate()&lt;/span&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;, which terminates&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;       execution. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-588806329168176579?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/588806329168176579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/keywords-throw-try-catch-and-example-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/588806329168176579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/588806329168176579'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/keywords-throw-try-catch-and-example-of.html' title='keywords throw / try /catch and example of their usage'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3994500645654540286</id><published>2010-07-24T17:17:00.002-04:00</published><updated>2010-07-24T17:25:16.817-04:00</updated><title type='text'>what is dynamic_cast?</title><content type='html'>&lt;pre&gt;&lt;span style="font-family:times new roman;"&gt; &lt;/span&gt;&lt;span class="high"  style="font-family:times new roman;"&gt;bool Box::operator==(const Shape&amp;amp; s) const {&lt;br /&gt;  return hght == &lt;span style="color: rgb(255, 102, 0);"&gt;dynamic_cast&lt;/span&gt;&lt;const&gt;(s).hght &amp;amp;&amp;amp;&lt;br /&gt;         wdth == &lt;span style="color: rgb(255, 102, 0);"&gt;dynamic_cast&lt;/span&gt;&lt;const&gt;(s).wdth &amp;amp;&amp;amp;&lt;br /&gt;         dpth == &lt;span style="color: rgb(204, 102, 0);"&gt;dynamic_cast&lt;/span&gt;&lt;const&gt;(s).dpth;&lt;br /&gt;}&lt;/const&gt;&lt;/const&gt;&lt;/const&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:verdana;" &gt;Answer:&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;The cast of the reference to a &lt;span class="code"&gt;Shape&lt;/span&gt; to a reference to a &lt;span class="code"&gt;Box&lt;/span&gt; is necessary to enable access to the size        instance variables of the &lt;span class="code"&gt;Box&lt;/span&gt;        object.  We call this a dynamic cast.  Without this        cast, the compiler would generate an error to the effect that        the size variables are not members of the &lt;span class="code"&gt;Shape&lt;/span&gt;&lt;/span&gt; class: &lt;/p&gt;                                       &lt;pre&gt;&lt;span style="font-size:78%;"&gt; bool Box::operator==(const Shape&amp;amp; s) const {&lt;br /&gt;    return hght == s.hght &amp;amp;&amp;amp; &lt;span class="high"&gt;// ERROR hght is not a member of s&lt;/span&gt;&lt;br /&gt;           wdth == s.wdth &amp;amp;&amp;amp; &lt;span class="high"&gt;// ERROR wdth is not a member of s&lt;/span&gt;&lt;br /&gt;           dpth == s.dpth;   &lt;span class="high"&gt;// ERROR dpth is not a member of s &lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: times new roman;font-size:100%;" &gt;On the other hand, receiving a reference to a &lt;span class="code"&gt;Box&lt;/span&gt; object directly would accept the definition&lt;/span&gt;&lt;/pre&gt;                                                   &lt;span style="font-family: arial;"&gt;bool Box::operator==(const&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-family: arial;"&gt; Box&amp;amp;&lt;/span&gt;&lt;span style="font-family: arial;"&gt; s) const { &lt;/span&gt;&lt;span style="font-family: arial;" class="high"&gt;// ERROR does not define                                            &lt;br /&gt;                                                                           // == const Shape&amp;amp; &lt;/span&gt;     &lt;br /&gt;    return hght == s.hght &amp;amp;&amp;amp; wdth == s.wdth &amp;amp;&amp;amp; dpth == s.dpth; &lt;br /&gt;} &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3994500645654540286?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3994500645654540286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/what-is-dynamiccast.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3994500645654540286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3994500645654540286'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/what-is-dynamiccast.html' title='what is dynamic_cast?'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-2269872096424279416</id><published>2010-07-24T15:20:00.003-04:00</published><updated>2010-07-24T17:07:00.929-04:00</updated><title type='text'>abstract class       Pure Virtual Functions</title><content type='html'>&lt;p&gt;An&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; abstract class&lt;/span&gt; identifies the properties that need to be        defined through pure virtual functions.  For instance, if a        Shape has a volume, then the abstract Shape class would include        a pure virtual function for volume.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 102, 255);"&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;The term interface refers to an abstract class        that contains no data members.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 102, 255);"&gt;and / or&lt;br /&gt;&lt;/p&gt;      &lt;span style="color: rgb(255, 102, 0);"&gt;A class that includes at least one pure virtual function is        an abstract base class.  (may contains data members on this situation)&lt;/span&gt;       &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" id="pur" class="section"&gt;Pure Virtual Functions&lt;/p&gt;         &lt;p&gt;A pure virtual function is a virtual function that has form        but no implementation.  The declaration of a pure virtual        function takes the form&lt;/p&gt;        &lt;pre class="defin"&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; &lt;/span&gt;&lt;span style="color: rgb(255, 153, 0);font-family:arial;" &gt;virtual type identifier(parameters) = 0;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-2269872096424279416?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/2269872096424279416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/abstract-class-pure-virtual-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/2269872096424279416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/2269872096424279416'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/abstract-class-pure-virtual-functions.html' title='abstract class       Pure Virtual Functions'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-823237341155509979</id><published>2010-07-24T10:47:00.003-04:00</published><updated>2010-07-24T14:54:26.563-04:00</updated><title type='text'></title><content type='html'>&lt;p id="vir" class="section"&gt;Virtual Inheritance&lt;/p&gt;         &lt;p&gt;To avoid duplication of the instance of the base class, the        &lt;span class="code"&gt;Box&lt;/span&gt; and &lt;span class="code"&gt;ColouredShape&lt;/span&gt; object can share the same        &lt;span class="code"&gt;Shape&lt;/span&gt; object.&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="font-size:85%;"&gt;// A Box&lt;br /&gt;// Box.h&lt;br /&gt;// Jun 9 2007&lt;br /&gt;&lt;br /&gt;#include "Shape.h"&lt;br /&gt;&lt;br /&gt;class Box : &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;font-size:85%;" class="high" &gt;virtual&lt;/span&gt;&lt;span style="font-size:85%;"&gt; public Shape {&lt;br /&gt; int hght;&lt;br /&gt; int wdth;&lt;br /&gt; int dpth;&lt;br /&gt;protected:&lt;br /&gt; void displayDetails() const;&lt;br /&gt;public:&lt;br /&gt; Box(const char* s, int h, int w, int d);&lt;br /&gt; virtual void display() const;&lt;br /&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Read more details&lt;a href="https://cs.senecac.on.ca/%7Ebtp300/pages/content/minhe.html"&gt; https://cs.senecac.on.ca/~btp300/pages/content/minhe.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h1 id="firstHeading" class="firstHeading"&gt;Diamond problem&lt;/h1&gt;    &lt;!-- /firstHeading --&gt;    &lt;!-- bodyContent --&gt;         &lt;!-- tagline --&gt;     &lt;div id="siteSub"&gt;From Wikipedia, the free encyclopedia&lt;/div&gt;     &lt;!-- /tagline --&gt;     &lt;!-- subtitle --&gt;          &lt;!-- /subtitle --&gt;                 &lt;!-- jumpto --&gt;     &lt;div id="jump-to-nav"&gt;      Jump to: &lt;a href="http://en.wikipedia.org/wiki/Diamond_problem#mw-head"&gt;navigation&lt;/a&gt;,      &lt;a href="http://en.wikipedia.org/wiki/Diamond_problem#p-search"&gt;search&lt;/a&gt;     &lt;/div&gt;     &lt;!-- /jumpto --&gt;         &lt;!-- bodytext --&gt;     &lt;div class="thumb tright"&gt; &lt;div class="thumbinner" style="width: 182px;"&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Diamond_inheritance.svg" class="image"&gt;&lt;img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Diamond_inheritance.svg/180px-Diamond_inheritance.svg.png" class="thumbimage" width="180" height="270" /&gt;&lt;/a&gt; &lt;div class="thumbcaption"&gt; &lt;div class="magnify"&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Diamond_inheritance.svg" class="internal" title="Enlarge"&gt;&lt;img src="http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png" alt="" width="15" height="11" /&gt;&lt;/a&gt;&lt;/div&gt; A diamond class inheritance diagram.&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;In &lt;a href="http://en.wikipedia.org/wiki/Object-oriented" title="Object-oriented" class="mw-redirect"&gt;object-oriented&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Programming_language" title="Programming language"&gt;programming languages&lt;/a&gt; with &lt;a href="http://en.wikipedia.org/wiki/Multiple_inheritance" title="Multiple inheritance"&gt;multiple inheritance&lt;/a&gt; and knowledge organization, the &lt;b&gt;diamond problem&lt;/b&gt; is an ambiguity that arises when two &lt;a href="http://en.wikipedia.org/wiki/Class_%28computer_science%29" title="Class (computer science)"&gt;classes&lt;/a&gt; B and C &lt;a href="http://en.wikipedia.org/wiki/Inheritance_%28computer_science%29" title="Inheritance (computer science)" class="mw-redirect"&gt;inherit&lt;/a&gt; from A, and class D inherits from both B and C. If a &lt;a href="http://en.wikipedia.org/wiki/Method_%28computer_science%29" title="Method (computer science)"&gt;method&lt;/a&gt; in D calls a method defined in A (and does not &lt;a href="http://en.wikipedia.org/wiki/Method_overriding_%28programming%29" title="Method overriding (programming)" class="mw-redirect"&gt;override&lt;/a&gt; the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C?&lt;/p&gt;&lt;p&gt;Please refer to &lt;a href="http://en.wikipedia.org/wiki/Diamond_problem"&gt;http://en.wikipedia.org/wiki/Diamond_problem&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-823237341155509979?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/823237341155509979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/virtual-inheritance-to-avoid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/823237341155509979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/823237341155509979'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/virtual-inheritance-to-avoid.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-1194654323863450774</id><published>2010-07-22T09:29:00.003-04:00</published><updated>2010-07-24T21:55:27.970-04:00</updated><title type='text'></title><content type='html'>&lt;p class="sssection"&gt;UNIX and Linux Scripts&lt;/p&gt;         The Unix environment variable &lt;span style="color: rgb(153, 0, 0);" class="code"&gt;$?&lt;/span&gt;        holds the return value from the program that has just completed        execution.&lt;br /&gt;&lt;br /&gt;&lt;p class="sssection"&gt;MS DOS&lt;/p&gt;         The MS-DOS environment variable &lt;span style="color: rgb(153, 0, 0);"&gt;%&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);" class="code"&gt;errorlevel&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;%&lt;/span&gt;  holds the return value from the program        that has just completed execution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-1194654323863450774?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/1194654323863450774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/unix-and-linux-scripts-unix-environment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1194654323863450774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/1194654323863450774'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/unix-and-linux-scripts-unix-environment.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-4397479198984134612</id><published>2010-07-22T08:14:00.002-04:00</published><updated>2010-07-22T09:03:54.024-04:00</updated><title type='text'></title><content type='html'>The macro &lt;span class="code"&gt;NULL&lt;/span&gt; is defined in        several system header files, including &lt;span class="code"&gt;stddef.h&lt;/span&gt;  and &lt;span class="code"&gt;stdio.h&lt;/span&gt;.&lt;br /&gt;It is good style to set every pointer that is        not currently holding a valid address to &lt;span class="code"&gt;NULL&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;p class="sssection"&gt;Odd Test&lt;/p&gt;         &lt;p&gt;The &lt;span class="code"&gt;&amp;amp;&lt;/span&gt; operator provides a        simple way to check if an integral value is odd: that is,        whether its least significant bit is 1.&lt;/p&gt;&lt;pre&gt; odd  = value &amp;amp; 1&lt;/pre&gt;&lt;p&gt;&lt;span class="code"&gt;odd&lt;/span&gt; has the value 1 if &lt;span class="code"&gt;value&lt;/span&gt; is odd, 0 if &lt;span class="code"&gt;value&lt;/span&gt;        is even.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-4397479198984134612?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/4397479198984134612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/macro-null-is-defined-in-several-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4397479198984134612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4397479198984134612'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/macro-null-is-defined-in-several-system.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-6949209757339526543</id><published>2010-07-21T23:01:00.004-04:00</published><updated>2010-07-21T23:26:50.188-04:00</updated><title type='text'></title><content type='html'>&lt;p&gt;Note that &lt;span class="code"&gt;sizeof()&lt;/span&gt; takes a type,        while &lt;span class="code"&gt;sizeof&lt;/span&gt; takes a variable, object        or expression.  With some compilers, the two operators are        interchangeable.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For normal usage, we may add the keyword &lt;span class="code"&gt;auto&lt;/span&gt;  (for automatic) to the definition &lt;/p&gt;         &lt;table style="width: 306px; height: 62px;" summary=""&gt;         &lt;tbody&gt;&lt;tr&gt;          &lt;td&gt;         &lt;br /&gt;         &lt;pre&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);" class="high"&gt;auto&lt;/span&gt; int local = 2;&lt;br /&gt;&lt;/pre&gt;         &lt;br /&gt;        &lt;/td&gt;         &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;         &lt;p&gt;Since this is the default for any function parameter or        any variable defined within a block, we seldom see this        keyword in practice. &lt;/p&gt;         &lt;p&gt;For very frequent usage, we add the keyword        &lt;span class="code"&gt;register&lt;/span&gt; to the definition &lt;/p&gt;                                     &lt;br /&gt;         &lt;pre&gt; &lt;span style="color: rgb(255, 0, 0);" class="high"&gt;register&lt;/span&gt; int local = 2;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);" class="high"&gt;static&lt;/span&gt; int local = 2;&lt;br /&gt;&lt;/pre&gt;&lt;p class="sssection"&gt;External Linkage&lt;/p&gt;         &lt;p&gt;A variable of static duration with external linkage can be        shared by several modules.  The compiler allocates memory        for the variable in one module and the linker allows all modules        access to that memory location.  Each reference to the variable        accesses the same memory location, regardless of the module from        which the reference is made.  To identify external linkage,        we add the keyword &lt;span class="code"&gt;extern&lt;/span&gt; to the        declaration&lt;/p&gt;                                      &lt;br /&gt;           &lt;span style="color: rgb(255, 0, 0);" class="high"&gt;extern&lt;/span&gt; int shared; &lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p class="ssection"&gt;C Conversion Specifiers&lt;/p&gt;         &lt;p&gt;The C language conversion specifiers for the        &lt;span class="code"&gt;int&lt;/span&gt; type used in calls to        &lt;span class="code"&gt;scanf()&lt;/span&gt; are&lt;/p&gt;                  &lt;table class="center" summary="input conversion specifiers" border="1" cellpadding="1" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr class="desc"&gt;          &lt;td align="center"&gt;          &lt;strong&gt;  Specifier  &lt;/strong&gt;&lt;/td&gt;           &lt;td&gt;&lt;strong&gt;Input Value&lt;/strong&gt;&lt;/td&gt;           &lt;td align="left"&gt;&lt;strong&gt;  Argument&lt;/strong&gt;&lt;/td&gt;           &lt;td&gt;&lt;strong&gt;Default Conversion&lt;/strong&gt;&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code" align="center"&gt;%c&lt;/td&gt;           &lt;td class="code"&gt;cc...c&lt;/td&gt;           &lt;td class="code" align="left"&gt;  char*&lt;/td&gt;           &lt;td&gt; one or more characters &lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code" align="center"&gt;%d&lt;/td&gt;           &lt;td class="code"&gt;[-|+]dd...d&lt;/td&gt;           &lt;td class="code" align="left"&gt;  int*  &lt;/td&gt;           &lt;td&gt;signed decimal&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code" align="center"&gt;%i&lt;/td&gt;           &lt;td class="code"&gt; [-|+][0[x]]dd...d &lt;/td&gt;           &lt;td class="code" align="left"&gt;  int*  &lt;/td&gt;           &lt;td&gt;signed integer&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code" align="center"&gt;%u&lt;/td&gt;           &lt;td class="code"&gt;[-|+]dd...d&lt;/td&gt;           &lt;td class="code" align="left"&gt;  unsigned*  &lt;/td&gt;           &lt;td&gt;unsigned decimal&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code" align="center"&gt;%o&lt;/td&gt;           &lt;td class="code"&gt;[-|+]dd...d&lt;/td&gt;           &lt;td class="code" align="left"&gt;  unsigned*  &lt;/td&gt;           &lt;td&gt;unsigned octal&lt;/td&gt;         &lt;/tr&gt;          &lt;tr class="value"&gt;          &lt;td class="code" align="center"&gt;%x&lt;/td&gt;           &lt;td class="code"&gt;[-|+][0x]dd...d&lt;/td&gt;           &lt;td class="code" align="left"&gt;  unsigned*  &lt;/td&gt;           &lt;td&gt;unsigned hexadecimal&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-6949209757339526543?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/6949209757339526543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/note-that-sizeof-takes-type-while.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6949209757339526543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6949209757339526543'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/note-that-sizeof-takes-type-while.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3451790803835872935</id><published>2010-07-16T23:24:00.001-04:00</published><updated>2010-07-16T23:25:47.915-04:00</updated><title type='text'></title><content type='html'>for myself remind&lt;br /&gt;&lt;br /&gt;create an account on the silverhouse.com?&lt;br /&gt;explorer the binary file format and operation in C++ to prepare for assignment&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3451790803835872935?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3451790803835872935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/for-myself-remind-create-account-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3451790803835872935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3451790803835872935'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/for-myself-remind-create-account-on.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-8528333045651416448</id><published>2010-07-12T11:03:00.000-04:00</published><updated>2010-07-12T11:04:07.169-04:00</updated><title type='text'></title><content type='html'>what is bitsfield?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-8528333045651416448?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/8528333045651416448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/what-is-bitsfield.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8528333045651416448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8528333045651416448'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/what-is-bitsfield.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-4217316506207948240</id><published>2010-07-11T22:08:00.003-04:00</published><updated>2010-07-11T23:48:25.146-04:00</updated><title type='text'>Linked List</title><content type='html'>2 posted articles I googled them&lt;br /&gt;&lt;a href="http://www.fredosaurus.com/notes-cpp/ds-lists/list-ex1a.html"&gt;http://www.fredosaurus.com/notes-cpp/ds-lists/list-ex1a.html&lt;/a&gt;  it supports *head and *back pointer.  which I'm perfer.&lt;br /&gt;&lt;a href="http://www.dreamincode.net/code/snippet82.htm"&gt;http://www.dreamincode.net/code/snippet82.htm&lt;/a&gt;  this one easy and clean for the beginner.&lt;br /&gt;&lt;br /&gt;To enable removeBack() method wihout using loop in linked list.  I guess unless I put another attribute of a point* of node to point the previous node; otherwise it is an unsolved quest.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-4217316506207948240?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/4217316506207948240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/linked-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4217316506207948240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4217316506207948240'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/07/linked-list.html' title='Linked List'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-2858575620363877894</id><published>2010-06-30T09:35:00.002-04:00</published><updated>2010-06-30T09:43:53.763-04:00</updated><title type='text'></title><content type='html'>computer stores number on  one/two's complemental code method.  true code, complemental code and one's complement code of unsigned number are all  equel;&lt;br /&gt;For example, 10 (decimal)  are all  00001010；&lt;br /&gt;&lt;br /&gt;But -10(decimal):&lt;br /&gt;true code：10001010   ('+' is 0, '-' is 1）&lt;br /&gt;&lt;br /&gt;complemental code：11110101   sign bit doesn't change, rest all of bits ~&lt;br /&gt;&lt;br /&gt;two's complemental code：11110110   base on complemental code plus 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-2858575620363877894?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/2858575620363877894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/computer-stores-number-on-onetwos.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/2858575620363877894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/2858575620363877894'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/computer-stores-number-on-onetwos.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-6724793903001775114</id><published>2010-06-28T17:31:00.000-04:00</published><updated>2010-06-28T17:32:07.512-04:00</updated><title type='text'></title><content type='html'>g++ ioframe_tester.cpp ioframe.cpp &lt;span style="color: rgb(255, 0, 0);"&gt;-x c iof.c&lt;/span&gt; -lncurses&lt;br /&gt;compile c code under c++ compiler&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-6724793903001775114?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/6724793903001775114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/g-ioframetester.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6724793903001775114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6724793903001775114'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/g-ioframetester.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-974417070129493358</id><published>2010-06-27T00:14:00.003-04:00</published><updated>2010-06-27T00:35:07.109-04:00</updated><title type='text'>need to write something down.</title><content type='html'>1st, I need to write some important points down during learning.&lt;br /&gt;2nd, to do&lt;br /&gt;make file of the project, need a review of oop244.&lt;br /&gt;new phase of the edit project&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-974417070129493358?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/974417070129493358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/need-to-write-something-down.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/974417070129493358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/974417070129493358'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/need-to-write-something-down.html' title='need to write something down.'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-8888555812553787859</id><published>2010-06-26T23:45:00.002-04:00</published><updated>2010-06-26T23:47:26.598-04:00</updated><title type='text'>a nice place to review bit operation</title><content type='html'>&lt;a href="http://yujinjeong.wordpress.com/"&gt;  http://yujinjeong.wordpress.com/ &lt;/a&gt;&lt;br /&gt;one of my classmates did a well job on the bit operation, simply link to his blog as my reference&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-8888555812553787859?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/8888555812553787859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/nice-place-to-review-bit-operation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8888555812553787859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8888555812553787859'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/nice-place-to-review-bit-operation.html' title='a nice place to review bit operation'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-4391458091059021318</id><published>2010-06-07T21:46:00.002-04:00</published><updated>2010-06-09T21:04:55.615-04:00</updated><title type='text'></title><content type='html'>&lt;a href="http://docs.google.com/Doc?id=dhbm9f8f_72gsdc8sgf"&gt;50 rules to learn C++ Language. (I filed it to encourage myself during study C++)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-4391458091059021318?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/4391458091059021318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/544562578qq.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4391458091059021318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/4391458091059021318'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/544562578qq.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-8714384020027539211</id><published>2010-06-07T19:46:00.001-04:00</published><updated>2010-06-07T19:55:38.219-04:00</updated><title type='text'>MemCpy()</title><content type='html'>inline void MemMoveBYTEHelp( char * pDest, char * pSrc, unsigned int iCount )&lt;br /&gt;{&lt;br /&gt;      __asm{&lt;br /&gt;            mov edi, pDest;&lt;br /&gt;            mov esi, pSrc;&lt;br /&gt;            mov ecx, iCount;&lt;br /&gt;            rep movsb;&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;云风的《游戏编程感悟》一书曾提到这个，里面说，64KB的内存拷贝是快不过 memcpy 的，因为VC中，memcpy 并是当做一个函数来编译的， 也就是说编程器会特别照顾 memcpy&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-8714384020027539211?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/8714384020027539211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/memcpy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8714384020027539211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8714384020027539211'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/memcpy.html' title='MemCpy()'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-7676328646183791564</id><published>2010-06-06T19:22:00.009-04:00</published><updated>2010-06-06T21:09:55.517-04:00</updated><title type='text'></title><content type='html'>&lt;pre&gt;     dumpHexa(&amp;amp;x, sizeof x);&lt;br /&gt;    putchar('\n');&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* Dump the first n bytes to the address a */&lt;br /&gt;void dumpHexa(&lt;span class="high"&gt;void *&lt;/span&gt;a, int n) {&lt;br /&gt;    int i;&lt;br /&gt;    unsigned char *c = (unsigned char *)a;&lt;br /&gt;&lt;br /&gt;    for (i = 0; i &lt; n; i++)&lt;br /&gt;        printf("%02x ", c[i]);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;           &lt;span style="font-size:85%;"&gt;------------------------------------------------------------------&lt;br /&gt;&lt;/span&gt;&lt;p class="ssection"  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;Synonym Pointer Types&lt;/span&gt;&lt;/p&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;Synonym pointer types simplify pointer definitions. &lt;/span&gt;&lt;/p&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;For example, let us define a synonym for a pointer to an        &lt;span class="code"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;                                       &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;           &lt;pre&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:times new roman;"&gt; typedef int * Pint;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;We can then define several pointer variables without having        to include the &lt;span class="code"&gt;*&lt;/span&gt; before each        identifier&lt;/p&gt;         &lt;table style="width: 306px; height: 31px;" summary=""&gt;         &lt;tbody&gt;&lt;tr&gt;          &lt;td&gt;           &lt;pre&gt;Pint px, py;&lt;br /&gt;&lt;/pre&gt;                     &lt;/td&gt;         &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;         &lt;p&gt;Note that this is more readable than the alternative primitive        definition&lt;/p&gt;                                                   int* px,* py;            &lt;pre&gt;------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:times new roman;"&gt;IEEE 754&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;1,8,23 or 1,23,8  for double, long .&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;1.52,11 or 1,11,52 for long long.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;p class="ssection"  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;Local Duration&lt;/span&gt;&lt;/p&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;A function parameter or a variable that is defined within a  block        has local extent unless otherwise specified.  Its        lifetime lasts from its definition until the closing brace of the        block that contains that definition. &lt;/span&gt;&lt;/p&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;There are two distinct usages of local types:&lt;/span&gt;&lt;/p&gt;         &lt;ul  style="font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;normal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;very frequent&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;For normal usage, we may add the keyword &lt;/span&gt;&lt;span class="code"  style="font-size:85%;"&gt;auto&lt;/span&gt;&lt;span style="font-size:85%;"&gt;  (for automatic) to the definition &lt;/span&gt;&lt;/p&gt;         &lt;table summary=""  width="45%" style="font-family:times new roman;"&gt;         &lt;tbody&gt;&lt;tr&gt;          &lt;td&gt;        &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;pre&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span class="high"  style="font-size:85%;"&gt;auto&lt;/span&gt;&lt;span style="font-size:85%;"&gt; int local = 2;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;        &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;       &lt;/td&gt;         &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;Since this is the default for any function parameter or        any variable defined within a block, we seldom see this        keyword in practice. &lt;/span&gt;&lt;/p&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;For very frequent usage, we add the keyword        &lt;/span&gt;&lt;span class="code"  style="font-size:85%;"&gt;register&lt;/span&gt;&lt;span style="font-size:85%;"&gt; to the definition &lt;/span&gt;&lt;/p&gt;         &lt;table summary=""  width="45%" style="font-family:times new roman;"&gt;         &lt;tbody&gt;&lt;tr&gt;          &lt;td&gt;        &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;pre&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span class="high"  style="font-size:85%;"&gt;register&lt;/span&gt;&lt;span style="font-size:85%;"&gt; int local = 2;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;        &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;       &lt;/td&gt;         &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;This keyword informs the compiler that the local variable        should, if possible, remain in a CPU register as long as  necessary.         However, since the number of registers is extremely limited, the  compiler        might not implement such a request.&lt;/span&gt;&lt;/p&gt;&lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="sssection"  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;Internal Linkage&lt;/span&gt;&lt;/p&gt;         &lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;A variable of static duration with internal linkage is        invisible outside its own module.  To identify internal        linkage, we add the keyword &lt;/span&gt;&lt;span class="code"  style="font-size:85%;"&gt;static&lt;/span&gt;&lt;span style="font-size:85%;"&gt; to        the definition&lt;/span&gt;&lt;/p&gt;                                     &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;         &lt;pre  style="font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span class="high"  style="font-size:85%;"&gt;static&lt;/span&gt;&lt;span style="font-size:85%;"&gt; int local = 2;&lt;br /&gt;/* Internal Linkage&lt;br /&gt;* static.c&lt;br /&gt;* May 12 2007&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;void display() {&lt;br /&gt;&lt;span class="high"&gt;static&lt;/span&gt; int local = 0;&lt;br /&gt;&lt;br /&gt;printf("local is %d\n", local++);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;&lt;br /&gt;display();&lt;br /&gt;display();&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;local is 0&lt;br /&gt;local is 1&lt;br /&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:times new roman;font-size:85%;" class="code"  &gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-7676328646183791564?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/7676328646183791564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/ieee-754-1823-or-1238-for-double-long.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7676328646183791564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/7676328646183791564'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/ieee-754-1823-or-1238-for-double-long.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3035081416824014833</id><published>2010-06-06T16:17:00.002-04:00</published><updated>2010-06-06T16:23:13.792-04:00</updated><title type='text'></title><content type='html'>&lt;p id="siz" class="section"&gt;Size of&lt;/p&gt;         &lt;p&gt;The &lt;span class="code"&gt;sizeof()&lt;/span&gt; operator evaluates to  the        size of a type in &lt;span class="c2"&gt;bytes&lt;/span&gt;.  The        &lt;span class="code"&gt;sizeof&lt;/span&gt; operator (without the        parentheses) evaluates to the size of a variable, object or        expression in bytes.  For example,&lt;/p&gt;         &lt;table summary="" width="95%"&gt;         &lt;tbody&gt;&lt;tr&gt;          &lt;td class="half"&gt;         &lt;br /&gt;         &lt;pre&gt; /* Type Sizes&lt;br /&gt;* sizeof.c&lt;br /&gt;* May 14 2007&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;   double x;&lt;br /&gt;   printf("On this machine, \n"&lt;br /&gt;    "the size of an int is %d bytes,\n"&lt;br /&gt;    "the size of x is %d bytes.\n",&lt;br /&gt;    sizeof(int), sizeof x );&lt;br /&gt;   return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/stdio.h&gt;&lt;/pre&gt;         &lt;br /&gt;        &lt;/td&gt;           &lt;td class="half"&gt;         &lt;br /&gt;         &lt;pre class="result"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On this machine,&lt;br /&gt;the size of an int is 4 bytes,&lt;br /&gt;the size of x is 8 bytes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;         &lt;br /&gt;        &lt;/td&gt;         &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;         &lt;p&gt;Note that &lt;span class="code"&gt;sizeof()&lt;/span&gt; takes a type,        while &lt;span class="code"&gt;sizeof&lt;/span&gt; takes a variable, object        or expression.  With some compilers, the two operators are        interchangeable.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="ssection"&gt;int type&lt;/p&gt;         &lt;p&gt;An &lt;span class="code"&gt;int&lt;/span&gt; type occupies one word of        memory.  One word is typically the size of a CPU        register, making the &lt;span class="code"&gt;int&lt;/span&gt; type        the optimally efficient type.  On 32-bit platforms, one        word spans 4 bytes:&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3035081416824014833?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3035081416824014833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/size-of-sizeof-operator-evaluates-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3035081416824014833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3035081416824014833'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/size-of-sizeof-operator-evaluates-to.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-6657701343016059096</id><published>2010-06-02T23:16:00.010-04:00</published><updated>2010-06-03T10:49:25.980-04:00</updated><title type='text'></title><content type='html'>A test is going to be taken tomorrow.  Follow is my review&lt;br /&gt;&lt;br /&gt;echo %errorlevel%&lt;br /&gt;&lt;br /&gt;int d=foo();&lt;br /&gt;return d;&lt;br /&gt;------------------------------------------&lt;br /&gt;int a[10] = {1,4,8,56,4,8,3,8,5,3};&lt;br /&gt;int n = 0, i;&lt;br /&gt;for(i=0;i&lt;10;i++){ i="0;i&lt;10;i++){"&gt;&lt;br /&gt;&lt;br /&gt;int main(void){&lt;br /&gt;int a = 5, b = 6;&lt;br /&gt;if(b &gt; 7 &amp;amp;&amp;amp; (a = a + 1)){&lt;br /&gt;    printf("X\n");&lt;br /&gt;}&lt;br /&gt;printf("%d\n", a);/* 5 since b &gt;7 is false */&lt;br /&gt;getchar();&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;--------------------------------------------&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;int main(void){&lt;br /&gt;int a[10]={1,4,9,0,4,6,3,2,5,3};&lt;br /&gt;int i=0;&lt;br /&gt;int j;&lt;br /&gt;for(;i&lt;10;){ i="0,j=" i="0,j="&gt;&lt;br /&gt;int main(void){&lt;br /&gt;int a[5]={10,20,30,40,50};&lt;br /&gt;int* p = &amp;amp;a[0]; //same as below */&lt;br /&gt;printf("%d ", *a);&lt;br /&gt;printf("%d ", *(p+0));&lt;br /&gt;printf("%d ", *(a+1));&lt;br /&gt;p++;&lt;br /&gt;printf("%d ", *(p+2));&lt;br /&gt;printf("%d ", (*p)++);&lt;br /&gt;printf("%d ", *(p+2));&lt;br /&gt;getchar();&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//answer 10 10 20 40 20 40&lt;br /&gt;---------------------------------------------------------&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;void foo(int** q){&lt;br /&gt;(*q)++;&lt;br /&gt;}&lt;br /&gt;int main(void){&lt;br /&gt;int a[5]={100,200,300,400,500};&lt;br /&gt;int* p = a;&lt;br /&gt;foo(&amp;amp;p);&lt;br /&gt;printf("%d\n", *p);&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// comments **q =&amp;p;&lt;br /&gt;--------------------------------&lt;br /&gt;&lt;br /&gt;#define PI 3.14159265       //It works In Borland C, don't work with VC and Lunix C&lt;br /&gt;int main(void){&lt;br /&gt;# ifdef sum&lt;br /&gt;printf("PI is defined\n");&lt;br /&gt;# elif PI == 3.14159265&lt;br /&gt;printf("PI is not defined\n");&lt;br /&gt;# endif&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;h1 style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="conditional"&gt;//Conditional Compilation (#if, #ifdef,     #ifndef, #else, #elif, #endif, and defined)&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;//&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(#ifdef #undef #endif)&lt;a name="conditional"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="conditional"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="conditional"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-6657701343016059096?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/6657701343016059096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/test-is-going-to-be-taken-tomorrow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6657701343016059096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6657701343016059096'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/06/test-is-going-to-be-taken-tomorrow.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-6447243729848183616</id><published>2010-05-20T08:18:00.007-04:00</published><updated>2010-05-20T09:38:11.330-04:00</updated><title type='text'>Macro</title><content type='html'>&lt;p class="ssection"&gt;Cited from BTP300 Chris seneca cs Web&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt; Continuation&lt;/li&gt;&lt;/ul&gt;         &lt;ul&gt;&lt;li&gt;&lt;p&gt;             A macro definition may extend over several lines.  The backslash character - &lt;span class="code"&gt;\&lt;/span&gt; -  immediately        followed by the end-of-line character identifies a continuation  onto        the next line.  For example,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;#define PI 3.141\&lt;br /&gt;592654&lt;br /&gt;is the same as&lt;br /&gt;#define PI 3.141592654&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Efficiency and Flexibility&lt;/p&gt;&lt;p&gt;Function-like macros provide efficient and flexible solutions.  They avoid the overhead of function calls and do not impose type constraints on the parameters in the macro definition.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;#define SQUARE(x)  &lt;span class="high"&gt;(&lt;/span&gt;&lt;span class="high"&gt;(&lt;/span&gt;x&lt;span class="high"&gt;)&lt;/span&gt; * &lt;span class="high"&gt;(&lt;/span&gt;x&lt;span class="high"&gt;)&lt;/span&gt;&lt;span class="high"&gt;)&lt;/span&gt; /* NOTE THE PARENTHESES *// Fardad noted in class&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;p id="sid" class="section"&gt;Side-Effects&lt;/p&gt;         &lt;p&gt;Macro definitions can also generate side effects.         Because the pre-processor substitutes textual patterns rather        than values, it can generate repeated evaluations of expressions        that were intended to be a single evaluation. Such as &lt;span style="color: rgb(255, 0, 0);"&gt;area(r++)&lt;/span&gt;.&lt;br /&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt; #define PI 3.14&lt;br /&gt;&lt;span class="high"&gt;#undef  PI&lt;/span&gt;&lt;br /&gt;#define PI 3.14159    /* OK */&lt;br /&gt;#define AREA(r) PI * r * r&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Predeined macros&lt;/li&gt;&lt;li&gt;&lt;pre&gt;     printf("The name of the source file is %s\n", __FILE__);&lt;br /&gt;printf("The date of its translation is %s\n", __DATE__);&lt;br /&gt;printf("The time of its translation is %s\n", __TIME__);&lt;br /&gt;if (__STDC__ != 0)&lt;br /&gt;    printf("Compiled under Standard C\n");&lt;br /&gt;else&lt;br /&gt;    printf("Not compiled under Standard C\n");&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;reference &lt;a href="https://cs.senecac.on.ca/%7Ebtp300/pages/content/macro.html"&gt;macro&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-6447243729848183616?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/6447243729848183616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/micro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6447243729848183616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/6447243729848183616'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/micro.html' title='Macro'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3065413463945244090</id><published>2010-05-20T08:00:00.000-04:00</published><updated>2010-05-20T08:03:50.891-04:00</updated><title type='text'></title><content type='html'>Cited from course BTP300 ,  Chris, seneca cs web&lt;br /&gt;&lt;ul&gt;&lt;li&gt;C and C++ compilers process source code in three distinct  stages:         pre-processing, compilation proper and linking&lt;/li&gt;&lt;li&gt;mixed language program require linkage convention  declarations         to ensure that the function identifiers used in the definition  and         in the function call are identical&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To resolve this incompatibility, we direct the C++ compiler to        use the "C" linkage convention in calling &lt;span class="code"&gt;hello()&lt;/span&gt;  rather than the default C++ convention.         We do so by wrapping the include directive in a linkage  convention        declaration:&lt;/li&gt;&lt;li&gt;&lt;pre&gt; &lt;span class="high"&gt;extern "C" {&lt;/span&gt;            /* identifies C linkage convention */&lt;br /&gt;    #include "hello.h"&lt;br /&gt;&lt;span class="high"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3065413463945244090?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3065413463945244090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/cited-from-course-btp300-chris-seneca.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3065413463945244090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3065413463945244090'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/cited-from-course-btp300-chris-seneca.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-414731381685790060</id><published>2010-05-19T08:20:00.000-04:00</published><updated>2010-05-19T10:44:42.294-04:00</updated><title type='text'>learning steps of SVN</title><content type='html'>A repository location, however, is always a URL.&lt;br /&gt;Schema Access Method&lt;br /&gt;file:/// direct repository access (on local disk)&lt;br /&gt;http:// access via WebDAV protocol to Subversionaware&lt;br /&gt;Apache server&lt;br /&gt;https:// same as http://, but with SSL encryption.&lt;br /&gt;svn:// access via custom protocol to an svnserve&lt;br /&gt;server&lt;br /&gt;svn+ssh:// same as svn://, but through an SSH tunnel.&lt;br /&gt;&lt;br /&gt;C:\&gt; svn checkout file:///X:/path/to/repos&lt;br /&gt;…&lt;br /&gt;C:\&gt; svn checkout "file:///X|/path/to/repos"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I create a personal Repository on my local disk.  It seems pointless to create a personal Repos as long as only me use my pc at beginning,  but I think it's still good idea to keep it in case i can trace my history codes even on offline status.  It's kind of "Time Machine".  I just wonder it is possible to sync one folder to 2 repositories?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-414731381685790060?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/414731381685790060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/learning-steps-of-svn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/414731381685790060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/414731381685790060'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/learning-steps-of-svn.html' title='learning steps of SVN'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-2689983810843458823</id><published>2010-05-17T19:15:00.000-04:00</published><updated>2010-05-17T19:20:53.899-04:00</updated><title type='text'>OOP344</title><content type='html'>Is Prof. Fardad's oop344 need use brain to get good mark?&lt;br /&gt;The answer is "YES", I guess.  I Didn't use my brain for long, it seems stuck right now,  not sure how much lube I should fill in to run it smoothly, might it's mission impossible.  Well, I will try my best.  It's time to warm up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-2689983810843458823?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/2689983810843458823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/oop344.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/2689983810843458823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/2689983810843458823'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/oop344.html' title='OOP344'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-8162117012334517928</id><published>2010-05-13T21:24:00.000-04:00</published><updated>2010-05-13T21:48:42.281-04:00</updated><title type='text'>mIRC</title><content type='html'>WebBased IRC&lt;br /&gt;&lt;a href="http://webchat.freenode.net/"&gt;http://webchat.freenode.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;the mIRC client supports multi-threads.  just right click the mIRC tray icon then click the channel name just above 'exit' it can switch back the  channel I want.  I cann't switch it back by press alt-tab keys.&lt;br /&gt;&lt;br /&gt;register username&lt;br /&gt;&lt;br /&gt;&lt;b&gt;/msg nickserv register &lt;your-password&gt; &lt;your-email&gt;&lt;/your-email&gt;&lt;/your-password&gt;&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;To keep your email address private, rather than displaying it publicly, mark  it as hidden:  &lt;blockquote&gt;&lt;b&gt;/msg nickserv set hidemail on&lt;/b&gt; &lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;It's useful, but not required, to have an alternate nick grouped to your  account. For example, if your primary nick is foo:  &lt;blockquote&gt;&lt;b&gt;/nick foo_&lt;/b&gt; &lt;/blockquote&gt;and then  &lt;blockquote&gt;&lt;b&gt;/msg nickserv group&lt;/b&gt; &lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;If you're running an older version of &lt;b&gt;xchat&lt;/b&gt; and you've requested a  cloak, you may need to &lt;a href="http://www.blogger.com/post-edit.g?blogID=2296207394520697058&amp;amp;postID=8162117012334517928#nocloakxchat"&gt;follow these instructions&lt;/a&gt; so  that your client will properly identify to &lt;b&gt;Nickserv&lt;/b&gt; before joining any  channels. Recent versions of xchat appear to handle things just fine.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Configure your client to identify itself to nickserv automatically whenever  it connects to freenode so that it's less likely you'll connect to the network  without being identified to nickserv. The easiest approach is to specify your  nickserv password as a server password.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-8162117012334517928?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/8162117012334517928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/mirc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8162117012334517928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/8162117012334517928'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/mirc.html' title='mIRC'/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2296207394520697058.post-3299456187438350304</id><published>2010-05-12T22:58:00.000-04:00</published><updated>2010-05-13T09:25:29.944-04:00</updated><title type='text'></title><content type='html'>May 12, 2010&lt;br /&gt;&lt;br /&gt;My first blog, which will be dedicated to OOP344.&lt;br /&gt;&lt;br /&gt;Fardad tries to let his students be familiar with lots of tools to apply in the open source environment.  I like the point.&lt;br /&gt;&lt;br /&gt;So far I have a personal wiki under the zenit site, a blog at myoop344blog.blogspot.com.&lt;br /&gt;&lt;br /&gt;I installed svn client on my pc, and will install one on my mac.&lt;br /&gt;&lt;br /&gt;also I have already added my personal information to student list, and my blog to planet CDOT feeder list&lt;br /&gt;&lt;br /&gt;installed a mIRC client I can login yesterday but I cann't login today since I tried to register the nicename xlu44 on the freenode irc server.&lt;br /&gt;&lt;br /&gt;I set my target on this course is A+.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2296207394520697058-3299456187438350304?l=myoop344blog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myoop344blog.blogspot.com/feeds/3299456187438350304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/may-12-2010-my-first-blog-which-will-be.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3299456187438350304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2296207394520697058/posts/default/3299456187438350304'/><link rel='alternate' type='text/html' href='http://myoop344blog.blogspot.com/2010/05/may-12-2010-my-first-blog-which-will-be.html' title=''/><author><name>xlu44</name><uri>http://www.blogger.com/profile/11144557496245121360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
