<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3016365607685677561</id><updated>2024-08-26T20:55:32.007-07:00</updated><category term="C"/><category term="CPP"/><category term="GPRS"/><category term="TCP"/><category term="verifone"/><category term="ACK"/><category term="Android"/><category term="Auth Authorization Capture Pre-authorization/Post-authorization Sale"/><category term="Automation"/><category term="Coding C C++"/><category term="Coding C C++ POS"/><category term="ECHO"/><category term="FarmVille"/><category term="I7910"/><category term="Ingenico"/><category term="OTP"/><category term="POS"/><category term="Paypass"/><category term="Timeout"/><category term="Vb.net"/><category term="advt"/><category term="as2805"/><category term="bank certification"/><category term="blog"/><category term="blogspot"/><category term="click"/><category term="client"/><category term="ctls"/><category term="ddl"/><category term="download"/><category term="emv"/><category term="fst"/><category term="google map"/><category term="gps"/><category term="iccsolution"/><category term="internet"/><category term="javascript"/><category term="master"/><category term="mobile"/><category term="qsvsdc"/><category term="server"/><category term="signing"/><category term="socket"/><category term="visa"/><category term="vx680"/><title type='text'>Get Wisdom Get Knowledge</title><subtitle type='html'>I am writing some of my coding experience.&#xa;My Interview experience.&#xa;What i know about Payment Industry, like ISO8583, XML, Credit Cards, Debit cards, VISA MASTER, EMV etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-3639478605464843656</id><published>2017-08-27T21:55:00.001-07:00</published><updated>2017-08-27T21:55:38.180-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ddl"/><category scheme="http://www.blogger.com/atom/ns#" term="download"/><category scheme="http://www.blogger.com/atom/ns#" term="fst"/><category scheme="http://www.blogger.com/atom/ns#" term="signing"/><category scheme="http://www.blogger.com/atom/ns#" term="verifone"/><title type='text'>Verifone automate signing for development</title><content type='html'>&lt;p dir=&quot;ltr&quot;&gt;Developer face 2 main issue with verifone development.&lt;br&gt;
1. No simulator like ingenico and pax.&lt;br&gt;
2. Signing and download process.&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;For simulator I haven&#39;t found any concrete solution.&lt;br&gt;
But for signing and download I have automated signing process using vbs.&lt;br&gt;
Below is vbs script for your reference.&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;&lt;b&gt;Vfn_App_Sign.vbs&lt;/b&gt;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;Set WshShell = WScript.CreateObject(&quot;&lt;a href=&quot;http://wscript.shell/&quot;&gt;WScript.Shell&lt;/a&gt;&quot;)&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;&lt;a href=&quot;http://wshshell.run/&quot;&gt;WshShell.Run&lt;/a&gt;&amp;#160;&quot;&quot;&quot;C:\Program Files\VERIFONE\FST\FST.exe&quot;&quot;&quot;, 9&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;&lt;b&gt;user id1&lt;/b&gt;&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;&lt;b&gt;user password1&lt;/b&gt;&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;^{ }&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;&lt;b&gt;user id2&lt;/b&gt;&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;&lt;b&gt;user password2&lt;/b&gt;&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{DOWN}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;^{ }&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;&lt;b&gt;card password1&lt;/b&gt;&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;&lt;b&gt;card&lt;/b&gt; &lt;b&gt;password2&lt;/b&gt;&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 10000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 2000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{TAB}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WshShell.SendKeys &quot;{ENTER}&quot;&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;WScript.Sleep 2000&lt;/p&gt;
&lt;p dir=&quot;ltr&quot;&gt;&lt;a href=&quot;http://wshshell.run/&quot;&gt;WshShell.Run&lt;/a&gt;&amp;#160;&quot;&lt;b&gt;dnld.bat&lt;/b&gt;&quot;&lt;/p&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/3639478605464843656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2017/08/verifone-automate-signing-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3639478605464843656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3639478605464843656'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2017/08/verifone-automate-signing-for.html' title='Verifone automate signing for development'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-8315424738595195858</id><published>2014-11-15T07:40:00.001-08:00</published><updated>2014-11-15T07:40:49.521-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="mobile"/><category scheme="http://www.blogger.com/atom/ns#" term="OTP"/><title type='text'>Android Development</title><content type='html'>My android work so far.&lt;div&gt;&lt;a href=&quot;https://play.google.com/store/apps/developer?id=USG%20Tech%20Solutions%20ltd.&amp;amp;hl=en&quot;&gt;https://play.google.com/store/apps/developer?id=USG%20Tech%20Solutions%20ltd.&amp;amp;hl=en&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/8315424738595195858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2014/11/android-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/8315424738595195858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/8315424738595195858'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2014/11/android-development.html' title='Android Development'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Gaur Grandeur Gaur Grandeur</georss:featurename><georss:point>28.585274 77.400749</georss:point></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-3986802505394266512</id><published>2014-06-05T03:23:00.001-07:00</published><updated>2014-06-09T09:22:25.738-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google map"/><category scheme="http://www.blogger.com/atom/ns#" term="GPRS"/><category scheme="http://www.blogger.com/atom/ns#" term="gps"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="TCP"/><title type='text'>Locate GPS enable device/terminal on your web server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;  
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 

&lt;script language=&quot;javascript&quot;&gt; 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Locate GPS enable device/terminal on your web server.&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Send GPS points(Lon,Lat) and unique ID of device/terminal on server via GPRS.&lt;br /&gt;
2.&amp;nbsp;&amp;nbsp;&amp;nbsp; Receive GPS points and ID from device/terminal.&lt;br /&gt;
3.&amp;nbsp;&amp;nbsp;&amp;nbsp; save GPS points and ID into flat file or database.&lt;br /&gt;
4.&amp;nbsp;&amp;nbsp;&amp;nbsp; Save below javascript code to locate multiple device/terminal on google map.&lt;br /&gt;
5.&amp;nbsp;&amp;nbsp;&amp;nbsp; add auto refresh function to reload page after fix interval of time.&lt;br /&gt;
&lt;br /&gt;
File Name Locate_Device.html&lt;br /&gt;
&lt;br /&gt;
//Start Of Locate_Device.html&amp;nbsp;&amp;nbsp; &amp;nbsp;--&amp;gt;&lt;br /&gt;
//ARAI file format one line one record.&lt;br /&gt;
//ID1,Lon1,Lat1&lt;br /&gt;
//ID2,Lon2,Lat2&lt;br /&gt;
//&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;script src=&quot;http://maps.googleapis.com/maps/api/js?key=AIzaSyAX4NEHbwolU-Nl8zzPRmQzsoJPWZ59jds&amp;amp;sensor=false&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
var Lat=28.798077;&lt;br /&gt;
var Lon=77.418766;&lt;br /&gt;
var myCenter;&lt;br /&gt;
var lineArr;&lt;br /&gt;
//Anand Rai&lt;br /&gt;
function AutoRefresh( t ) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setTimeout(&quot;location.reload(true);&quot;, t);&lt;br /&gt;
}&lt;br /&gt;
function initialize()&lt;br /&gt;
{&lt;br /&gt;
readTextFile();&lt;br /&gt;
myCenter=new google.maps.LatLng(Lat, Lon);&lt;br /&gt;
var mapProp = {&lt;br /&gt;
&amp;nbsp; center:myCenter,&lt;br /&gt;
&amp;nbsp; zoom:15,&lt;br /&gt;
&amp;nbsp; mapTypeId:google.maps.MapTypeId.ROADMAP&lt;br /&gt;
&amp;nbsp; };&lt;br /&gt;
var map=new google.maps.Map(document.getElementById(&quot;googleMap&quot;)&lt;br /&gt;
&amp;nbsp; ,mapProp);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;br /&gt;
for (var i = 0; i &amp;lt; lineArr.length -1; i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var LocationArr = lineArr[i].split(&#39;,&#39;); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var latLng = new google.maps.LatLng(LocationArr[1], LocationArr[2]);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var marker = new google.maps.Marker({&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; position:latLng&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; marker.setMap(map);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var infowindow = new google.maps.InfoWindow({&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;content:&#39;Terminal&amp;lt;br&amp;gt;&#39; + LocationArr[0]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;});&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; infowindow.open(map,marker);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
function readTextFile()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var rawFile = new XMLHttpRequest();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rawFile.open(&quot;GET&quot;, &quot;ARAI&quot;, false);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rawFile.onreadystatechange = function ()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(rawFile.readyState === 4)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(rawFile.status === 200 || rawFile.status == 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var allText = rawFile.responseText;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lineArr = allText.split(&#39;\n&#39;); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;var line1Arr = lineArr[1].split(&#39;,&#39;); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Lat=line1Arr[1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Lon=line1Arr[2];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rawFile.send(null);&lt;br /&gt;
}&lt;br /&gt;
google.maps.event.addDomListener(window, &#39;load&#39;, initialize);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onload=&quot;JavaScript:AutoRefresh(60000);&quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&quot;googleMap&quot; style=&quot;width:800px;height:600px;&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
//End Of Locate_Device.html&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;-- &lt;/div&gt;
&lt;pre class=&quot;brush: javascript&quot;&gt;&lt;!------&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/3986802505394266512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2014/06/locate-gps-enable-deviceterminal-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3986802505394266512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3986802505394266512'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2014/06/locate-gps-enable-deviceterminal-on.html' title='Locate GPS enable device/terminal on your web server'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-8583156204920978870</id><published>2013-05-07T02:53:00.000-07:00</published><updated>2013-05-07T02:53:20.288-07:00</updated><title type='text'>MyLocation</title><content type='html'>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
&lt;p id=&quot;demo&quot;&gt;Click the button to get your position:&lt;/p&gt;
&lt;button onclick=&quot;getLocation()&quot;&gt;Try It&lt;/button&gt;
&lt;div id=&quot;mapholder&quot;&gt;&lt;/div&gt;
&lt;script src=&quot;http://maps.google.com/maps/api/js?sensor=false&quot;&gt;&lt;/script&gt;
&lt;script&gt;
var x=document.getElementById(&quot;demo&quot;);
function getLocation()
  {
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition,showError);
    }
  else{x.innerHTML=&quot;Geolocation is not supported by this browser.&quot;;}
  }

function showPosition(position)
  {
  lat=position.coords.latitude;
  lon=position.coords.longitude;
  latlon=new google.maps.LatLng(lat, lon)
  mapholder=document.getElementById(&#39;mapholder&#39;)
  mapholder.style.height=&#39;250px&#39;;
  mapholder.style.width=&#39;500px&#39;;

  var myOptions={
  center:latlon,zoom:16,
  mapTypeId:google.maps.MapTypeId.ROADMAP,
  mapTypeControl:false,
  navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL}
  };
  var map=new google.maps.Map(document.getElementById(&quot;mapholder&quot;),myOptions);
  var marker=new google.maps.Marker({position:latlon,map:map,title:&quot;You are here!&quot;});
  }

function showError(error)
  {
  switch(error.code) 
    {
    case error.PERMISSION_DENIED:
      x.innerHTML=&quot;User denied the request for Geolocation.&quot;
      break;
    case error.POSITION_UNAVAILABLE:
      x.innerHTML=&quot;Location information is unavailable.&quot;
      break;
    case error.TIMEOUT:
      x.innerHTML=&quot;The request to get user location timed out.&quot;
      break;
    case error.UNKNOWN_ERROR:
      x.innerHTML=&quot;An unknown error occurred.&quot;
      break;
    }
  }
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/8583156204920978870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2013/05/mylocation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/8583156204920978870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/8583156204920978870'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2013/05/mylocation.html' title='MyLocation'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2617305013916792457</id><published>2013-02-05T10:14:00.000-08:00</published><updated>2013-02-05T10:14:52.311-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Automation"/><category scheme="http://www.blogger.com/atom/ns#" term="click"/><category scheme="http://www.blogger.com/atom/ns#" term="FarmVille"/><category scheme="http://www.blogger.com/atom/ns#" term="Vb.net"/><title type='text'>Automate FarmVille click in Vb.net for FarmVille addicted people</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;I was very addicted to farmville online game. It have some good strategy things and some most boring and painful thing like farming big farm like 20X20.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;Then i have write a small program in VB.net to automate farming using auto click.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;You can download this&amp;nbsp; program executable from below link.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;a href=&quot;https://docs.google.com/folder/d/0B5G4itY9P9sfWlJKdlQyT1pOSjg/edit?usp=sharing&quot;&gt;&lt;b&gt;https://docs.google.com/folder/d/0B5G4itY9P9sfWlJKdlQyT1pOSjg/edit?usp=sharing&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;or you can download source from below link and generate your own version for auto farming and many other boring things.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;a href=&quot;https://docs.google.com/folder/d/0B5G4itY9P9sfN2tqRlJXM3RjR1U/edit?usp=sharing&quot;&gt;&lt;b&gt;https://docs.google.com/folder/d/0B5G4itY9P9sfN2tqRlJXM3RjR1U/edit?usp=sharing&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;You can&amp;nbsp; see Video at below link to how to use this program.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;a href=&quot;http://youtu.be/WHsbRbPCXv4&quot;&gt;http://youtu.be/WHsbRbPCXv4&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/WHsbRbPCXv4?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;You need &quot;Microsoft Visual Basic 2010&quot; (which is free)&amp;nbsp;&lt;/b&gt;for compilation and make changes.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;Happy Farming :)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2617305013916792457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2013/02/automate-farmville-click-in-vbnet-for.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2617305013916792457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2617305013916792457'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2013/02/automate-farmville-click-in-vbnet-for.html' title='Automate FarmVille click in Vb.net for FarmVille addicted people'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2959948024268545893</id><published>2013-01-08T00:40:00.000-08:00</published><updated>2014-10-29T05:35:20.528-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="advt"/><category scheme="http://www.blogger.com/atom/ns#" term="as2805"/><category scheme="http://www.blogger.com/atom/ns#" term="bank certification"/><category scheme="http://www.blogger.com/atom/ns#" term="ctls"/><category scheme="http://www.blogger.com/atom/ns#" term="emv"/><category scheme="http://www.blogger.com/atom/ns#" term="iccsolution"/><category scheme="http://www.blogger.com/atom/ns#" term="master"/><category scheme="http://www.blogger.com/atom/ns#" term="Paypass"/><category scheme="http://www.blogger.com/atom/ns#" term="qsvsdc"/><category scheme="http://www.blogger.com/atom/ns#" term="verifone"/><category scheme="http://www.blogger.com/atom/ns#" term="visa"/><category scheme="http://www.blogger.com/atom/ns#" term="vx680"/><title type='text'>EMV implementation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If you are working on EMV implementation on any new device.&lt;br /&gt;
Please make sure that you have latest EMV testing kit, latest device EMV kernel, Device OS, and latest VISA and Master guideline, latest Device Chip and Pin EMV and CTLS EMV Sample.&lt;br /&gt;
Vendor like Verifone Ingenico also provide training and sample for EMV and CTLS. &lt;br /&gt;
VISA Chip and Pin, VISA qsVSDC implementation is very easy and works on device default setting you don&#39;t need to do much effort to follow their guidelines.&lt;br /&gt;
MasterCard Chip and Pin, Paypass implementation is always pain because of their complex guidelines and device setting.&lt;br /&gt;
Amex implementation always looks complex but it is simple if they support you.&lt;br /&gt;
You can get EMV kit from ICCSolution, Fime, etc...&lt;br /&gt;
Master Visa guidelines from Bank.&lt;br /&gt;
You also need one good host simulator for fast development. FinSim is best.&lt;br /&gt;
You can get helpful documents from website like &lt;cite&gt;scribd&amp;nbsp;&lt;/cite&gt;for APACS, VISA Master EMV, CTLS.&lt;br /&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-3d5a48fb-5bc7-f3c1-caa6-0089259bd06a&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;What is EMV and EMV history?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.emvco.com/best_practices.aspx?id=217&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; vertical-align: baseline;&quot;&gt;http://www.emvco.com/best_practices.aspx?id=217&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.scribd.com/doc/19132770/EMV-Host-Testing-Considerations&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132770/EMV-Host-Testing-Considerations&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.scribd.com/doc/19132795/L2-Test-Cases-v41e&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132795/L2-Test-Cases-v41e&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;http://www.scribd.com/doc/19132787/Intro-to-EMV&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132787/Intro-to-EMV&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-3d5a48fb-5be2-49b7-c821-7b992d8d77c9&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132768/EMV&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132810/Standard-70-Book-1-1-June-2007&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132767/EMV-v4-1-Book-1-ICC-to-Terminal-Interface&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132765/EMV-Contact-Less-Communication-Protocol-v2-0&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132750/Book-2&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132743/Book-3&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;http://www.scribd.com/doc/19132747/Book4&lt;/span&gt;&lt;/div&gt;
&lt;a href=&quot;https://www.scribd.com/doc/19132734/American-Express-EMV-Certification-Guide&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;https://www.scribd.com/doc/19132734/American-Express-EMV-Certification-Guide&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-3d5a48fb-5bc8-388e-5fc5-363a1581d5c4&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;EMV transaction flow:-&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a href=&quot;http://www.level2kernel.com/flow_chart.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; vertical-align: baseline;&quot;&gt;http://www.level2kernel.com/flow_chart.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-3d5a48fb-5bca-593b-c795-d915cc8190f2&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Verifone EMV webinar&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a href=&quot;http://www.verifonezone.com/fstore/0a463145bbfccb42_-634f7072_13697cf8344_-7a8b/EMV_201_Webinar_041012.pdf&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.verifonezone.com/fstore/0a463145bbfccb42_-634f7072_13697cf8344_-7a8b/EMV_201_Webinar_041012.pdf&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-3d5a48fb-5bca-e28c-7947-4fc580676d3e&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;EMV TAG Decoder&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;http://tvr-decoder.appspot.com/t/home&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://tvr-decoder.appspot.com/t/home&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;EMV transaction Steps:-&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: transparent; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; id=&quot;docs-internal-guid-6deed688-5bcc-ee4c-870c-d1ec1dd05fce&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Card Detection and Reset&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Candidate List Creation&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Application Selection&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Read Application Data&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Data Authentication&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Cardholder Verification&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Processing Restrictions&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Terminal Risk Management&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Terminal Action Analysis&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Card Action Analysis&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Online Offline Decision&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Online Processing&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Second Card Action Analysis&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Transaction Completed&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;cite&gt;&lt;br /&gt;&lt;/cite&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2959948024268545893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2013/01/emv-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2959948024268545893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2959948024268545893'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2013/01/emv-implementation.html' title='EMV implementation'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-7171051650097364026</id><published>2011-09-30T10:29:00.000-07:00</published><updated>2011-09-30T10:29:29.792-07:00</updated><title type='text'>Guide</title><content type='html'>&lt;iframe src=&quot;http://www.youtube.com/embed/gGDHXk2RatQ?fs=1&quot; allowfullscreen=&quot;&quot; width=&quot;459&quot; frameborder=&quot;0&quot; height=&quot;344&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/7171051650097364026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/09/guide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/7171051650097364026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/7171051650097364026'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/09/guide.html' title='Guide'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/gGDHXk2RatQ/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2991342698017326772</id><published>2011-09-02T09:41:00.000-07:00</published><updated>2011-09-02T09:41:55.044-07:00</updated><title type='text'>Tech Guru: Static and Non Static Synchronized Methods</title><content type='html'>&lt;a href=&quot;http://techi-guru.blogspot.com/2011/09/static-and-non-static-synchronized.html?spref=bl&quot;&gt;Tech Guru: Static and Non Static Synchronized Methods&lt;/a&gt;: Hi Friends,     This is my first post. I hope you will like this one.     Have you ever thought about the behavior of a static synchronize...</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2991342698017326772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/09/tech-guru-static-and-non-static.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2991342698017326772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2991342698017326772'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/09/tech-guru-static-and-non-static.html' title='Tech Guru: Static and Non Static Synchronized Methods'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-369392412536523197</id><published>2011-09-01T10:03:00.000-07:00</published><updated>2011-09-01T10:03:25.684-07:00</updated><title type='text'>Aaja Sanam Madhur Chandani - Raj Kapoor, Nargis, Chori Chori song (Duet)</title><content type='html'>&lt;iframe src=&quot;http://www.youtube.com/embed/ru_dTdBXfN4?fs=1&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/369392412536523197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/09/aaja-sanam-madhur-chandani-raj-kapoor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/369392412536523197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/369392412536523197'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/09/aaja-sanam-madhur-chandani-raj-kapoor.html' title='Aaja Sanam Madhur Chandani - Raj Kapoor, Nargis, Chori Chori song (Duet)'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/ru_dTdBXfN4/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2629304649859188713</id><published>2011-08-18T07:02:00.000-07:00</published><updated>2011-08-18T07:02:19.826-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blog"/><category scheme="http://www.blogger.com/atom/ns#" term="blogspot"/><category scheme="http://www.blogger.com/atom/ns#" term="internet"/><title type='text'>My new blog</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;This is not a specific blog, this is all about everything i am reading on internet and want to share with you.&lt;br /&gt;
&lt;a href=&quot;http://something-like2share.blogspot.com/&quot;&gt;http://something-like2share.blogspot.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2629304649859188713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/08/my-new-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2629304649859188713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2629304649859188713'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/08/my-new-blog.html' title='My new blog'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2828490515421657961</id><published>2011-07-01T23:53:00.000-07:00</published><updated>2011-07-01T23:53:07.106-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ACK"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><category scheme="http://www.blogger.com/atom/ns#" term="ECHO"/><category scheme="http://www.blogger.com/atom/ns#" term="GPRS"/><category scheme="http://www.blogger.com/atom/ns#" term="POS"/><category scheme="http://www.blogger.com/atom/ns#" term="TCP"/><category scheme="http://www.blogger.com/atom/ns#" term="Timeout"/><title type='text'>How To Keep Alive TCP connection in case of GPRS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Requirement &lt;/b&gt;: POS terminal need permanent TCP&amp;nbsp;connection&amp;nbsp;with server on&amp;nbsp;GPRS.&lt;br /&gt;
&lt;b&gt;Problem &lt;/b&gt;: Connection break after some time(some minutes/ some hours)&lt;br /&gt;
&lt;b&gt;Reason &lt;/b&gt;: May be Client/Server or Network Closing TCP connection due to inactivity of communication.&lt;br /&gt;
&lt;b&gt;Solution &lt;/b&gt;: Send any message after every minute to server, So that it wont idle and wont disconnect.&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;: &lt;u&gt;You can do some Hit and trial and check maximum time span to keep alive your TCP connection.&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;I think every network have different timeout(not sure).&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2828490515421657961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/07/how-to-keep-alive-tcp-connection-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2828490515421657961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2828490515421657961'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/07/how-to-keep-alive-tcp-connection-in.html' title='How To Keep Alive TCP connection in case of GPRS'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-1283158853761978152</id><published>2011-06-18T21:48:00.000-07:00</published><updated>2011-06-19T11:15:04.506-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="client"/><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="socket"/><title type='text'>Client Server Programming</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;If you involve with client server programming at any level of programming and you didn&#39;t read &quot;Beej&#39;s Guide to Network Programming&quot; then you must read this document.&lt;br /&gt;
This is one of the simplest document available on internet for starting client server programming in C language.&lt;br /&gt;
I am using this document from last 5(approx.) year for all TCP/IP based communication module and UDP logger.&lt;br /&gt;
&lt;br /&gt;
Author Page:- http://beej.us/&lt;br /&gt;
&lt;br /&gt;
Beej&#39;s Guide to Network Programming :- http://beej.us/guide/&lt;br /&gt;
beej.us/guide/bgnet/output/print/bgnet_A4.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/1283158853761978152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/06/client-server-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/1283158853761978152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/1283158853761978152'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/06/client-server-programming.html' title='Client Server Programming'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Rajat Vihar, Khora Colony, NOIDA, Uttar Pradesh, India</georss:featurename><georss:point>28.610379736698089 77.343717438491808</georss:point><georss:box>28.609061236698089 77.3395199384918 28.611698236698089 77.347914938491812</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-471679382286124778</id><published>2011-06-10T20:22:00.000-07:00</published><updated>2011-06-10T20:22:52.989-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Coding C C++ POS"/><category scheme="http://www.blogger.com/atom/ns#" term="I7910"/><category scheme="http://www.blogger.com/atom/ns#" term="Ingenico"/><title type='text'>GPRS Application on Ingenico I7910Terminal</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;If you are developing GPRS based application on Ingenico terminal then use GCL library. It save your lots of time.You need to manage only around 50-100 lines of code. But it have less configuration option.&lt;br /&gt;
&lt;br /&gt;
If you want all GSM feature then go with UNICAPT library.In this case you need to manage around 500 lines of code.&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/471679382286124778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/06/gprs-application-on-ingenico.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/471679382286124778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/471679382286124778'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/06/gprs-application-on-ingenico.html' title='GPRS Application on Ingenico I7910Terminal'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total><georss:featurename>Rajat Vihar, Khora Colony, NOIDA, Uttar Pradesh, India</georss:featurename><georss:point>28.610304386232496 77.343749624999987</georss:point><georss:box>28.608985886232496 77.339552124999983 28.611622886232496 77.34794712499999</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2517483331953258257</id><published>2011-06-07T11:20:00.000-07:00</published><updated>2011-06-07T11:23:34.855-07:00</updated><title type='text'>POS Terminal (Ingenico / Verifone / Hypercom / MX Series )</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Do you have any issue related to Ingenico / Verifone / Hypercom terminal application Development then please comment or email me.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2517483331953258257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/06/ingenico-terminal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2517483331953258257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2517483331953258257'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/06/ingenico-terminal.html' title='POS Terminal (Ingenico / Verifone / Hypercom / MX Series )'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-3043405532905018480</id><published>2011-01-27T08:59:00.000-08:00</published><updated>2011-01-28T06:50:49.072-08:00</updated><title type='text'>Payment Security Standard</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;PCI DSS&lt;/b&gt; Certification &amp;nbsp;&amp;nbsp;&amp;nbsp; - Payment card Industry Data Security Standard&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;PCI PED&lt;/b&gt; Certification &amp;nbsp;&amp;nbsp;&amp;nbsp; - Payment Card Industry PIN Entry Device &lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;EMV L1&lt;/b&gt; Certification&amp;nbsp;&amp;nbsp;&amp;nbsp; - EMV Level 1, which covers physical, electrical and transport level interfaces&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;EMV L2&lt;/b&gt; Certification &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - EMV Level 2, which covers payment application selection and credit financial transaction processing.&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;MasterCard PTS&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - MasterCard Point of Sale Terminal Security&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;PBOC &lt;/b&gt;Certification &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Bank Of China Certification&lt;br /&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;b&gt;PA DSS&lt;/b&gt; Certification &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Payment Application Data Security Standard &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Ref:&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;https://www.pcisecuritystandards.org&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://en.wikipedia.org&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Times New Roman; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/3043405532905018480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/01/payment-security-standard.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3043405532905018480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3043405532905018480'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/01/payment-security-standard.html' title='Payment Security Standard'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-2116858269507670797</id><published>2011-01-18T06:14:00.000-08:00</published><updated>2013-04-14T06:26:01.419-07:00</updated><title type='text'>My Interview Questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
You can visit below wbsite for your Interview preparation.&lt;br /&gt;
&lt;a href=&quot;http://www.cplusplus.com/&quot; id=&quot;internal-source-marker_0.23360553079031587&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;www.cplusplus.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.geeksforgeeks.org/archives/24173&quot; id=&quot;internal-source-marker_0.23360553079031587&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.geeksforgeeks.org&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.java2s.com/Tutorial/Cpp/CatalogCpp.htm&quot; id=&quot;internal-source-marker_0.23360553079031587&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.java2s.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://c-faq.com/&quot;&gt;http://c-faq.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol id=&quot;internal-source-marker_0.7231420732314554&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;what is copy constructor, and where it&#39;s require?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 14 Mar 2011(004)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Copy_constructor&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://en.wikipedia.org/wiki/Copy_constructor&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;copy constructor&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; is a special constructor in the C++ programming language used to create a new &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;object as a copy&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 of an existing object. The first argument of such a constructor is a 
reference to an object of the same type as is being constructed (const 
or non-const), which might be followed by parameters of any type (all 
having default values).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Normally the compiler automatically creates a copy constructor for each class (known as a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;default&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; copy constructor) but for special cases the programmer creates the copy constructor, known as a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;user-defined&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; copy constructor. In such cases, the compiler does not create one.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A
 user-defined copy constructor is generally needed when an object owns 
pointers or non-shareable references, such as to a file, in which case a
 destructor and an assignment operator should also be written (Rule of 
three).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;X (const X&amp;amp; copy_from_me);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;X (X&amp;amp; copy_from_me);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;X (const volatile X&amp;amp; copy_from_me);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;X (volatile X&amp;amp; copy_from_me);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;X (const X&amp;amp; copy_from_me, int = 10);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;X (const X&amp;amp; copy_from_me, double = 1.0, int = 40);&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The following cases may result in a call to a copy constructor:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When an object is returned by value&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When an object is passed (to a function) by value as an argument&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When an object is thrown&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When an object is caught&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When an object is placed in a brace-enclosed initializer list&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;These cases are collectively called &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;copy-initialization&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; and are equivalent to:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;T x = a&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 copy assignment operator differs from the copy constructor in that it 
must clean up the data members of the assignment&#39;s target (and correctly
 handle self-assignment) whereas the copy constructor assigns values to 
uninitialized data members.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;My_Array first; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// initialization by default constructor&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;My_Array second(first); &amp;nbsp;&amp;nbsp;// initialization by copy constructor&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;My_Array third = first; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Also initialization by copy constructor&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;second = third; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// assignment by copy assignment operator&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;2&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;what &#39;s difference between calloc and malloc ?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 14 Mar 2011(004)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://c-faq.com/malloc/calloc.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://c-faq.com/malloc/calloc.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;calloc(m, n) is essentially equivalent to&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = malloc(m * n);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;+&lt;br class=&quot;kix-line-break&quot; /&gt;memset(p, 0, m * n);&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;There is no important difference between the two other than the number of arguments and the zero fill.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.cplusplus.com/&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;www.cplusplus.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Malloc:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Allocates a block of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; bytes of memory, returning a pointer to the beginning of the block.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The content of the newly allocated block of &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;memory is not initialized&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;, remaining with indeterminate values.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Calloc:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Allocate space for array in memory&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Allocates a block of memory for an array of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;num&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; elements, each of them &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; bytes long, and &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;initializes all its bits to zero&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The effective result is the allocation of an zero-initialized memory block of (&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;num&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; * &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;) bytes.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;3&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;what is C++ References?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 16 Mar 2011(002)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A
 reference variable is an alias, that is, another name for an already 
existing variable. Once a reference is initialized with a variable, 
either the variable name or the reference name may be used to refer to 
the variable.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;C++ References vs Pointers:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;References are often confused with pointers but three major differences between references and pointers are:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;You cannot have NULL references&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. You must always be able to assume that a reference is connected to a legitimate piece of storage.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Once a reference is initialized to an object, it &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;cannot be changed&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; to refer to another object. Pointers can be pointed to another object at any time.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A reference &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;must be initialized&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; when it is created. Pointers can be initialized at any time.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Creating References in C++:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Think
 of a variable name as a label attached to the variable&#39;s location in 
memory. You can then think of a reference as a second label attached to 
that memory location. Therefore, you can access the contents of the 
variable through either the original variable name or the reference. For
 example, suppose we have the following example:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int &amp;nbsp;&amp;nbsp;&amp;nbsp;i = 17;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;We can declare reference variables for i as follows.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int&amp;amp; &amp;nbsp;&amp;nbsp;&amp;nbsp;r = i;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Read the &amp;amp; in these declarations as &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;reference&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.
 Thus, read the first declaration as &quot;r is an integer reference 
initialized to i&quot; and read the second declaration as &quot;s is a double 
reference initialized to d.&quot;. Following example makes use of references 
on int and double:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include &lt;iostream&gt;&lt;/iostream&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;using namespace std;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int main ()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;// declare simple variables&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;int &amp;nbsp;&amp;nbsp;&amp;nbsp;i;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;double d;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;// declare reference variables&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;int&amp;amp; &amp;nbsp;&amp;nbsp;&amp;nbsp;r = i;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;double&amp;amp; s = d;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;i = 5;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;Value of i : &quot; &amp;lt;&amp;lt; i &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;Value of i reference : &quot; &amp;lt;&amp;lt; r &amp;nbsp;&amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;d = 11.7;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;Value of d : &quot; &amp;lt;&amp;lt; d &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;Value of d reference : &quot; &amp;lt;&amp;lt; s &amp;nbsp;&amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;return 0;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When the above code is compiled together and executed, it produces following result:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Value of i : 5&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Value of i reference : 5&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Value of d : 11.7&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Value of d reference : 11.7&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;References are usually used for function argument lists and function return values.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; So following are two important subjects related to C++ references which should be clear to a C++ programmer:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;4&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;what is difference enum and union?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 14 Mar 2011(004)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.cplusplus.com/&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;www.cplusplus.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Enumerations (enum)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Enumerations create new data types to contain something different that is not limited to the values &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;fundamental data types may take. Its form is the following:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;enum enumeration_name {&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;value1,&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;value2,&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;value3,&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;.&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;.&lt;br class=&quot;kix-line-break&quot; /&gt;} object_names;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;For example, we could create a new type of variable called colors_t to store colors with the following declaration:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;416&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;enum colors_t {black, blue, green, cyan, red, purple, yellow, white};&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Notice
 that we do not include any fundamental data type in the declaration. To
 say it somehow, we have created a whole new data type from scratch 
without basing it on any other existing type. The possible values that 
variables of this new type color_t may take are the new constant values 
included within braces. For example, once the colors_t enumeration is 
declared the following expressions will be valid:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;24&quot;&gt;&lt;/col&gt;&lt;col width=&quot;600&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;colors_t mycolor;&lt;br class=&quot;kix-line-break&quot; /&gt; &lt;br class=&quot;kix-line-break&quot; /&gt;mycolor = blue;&lt;br class=&quot;kix-line-break&quot; /&gt;if (mycolor == green) mycolor = red;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: #ead1dc; color: #cc0000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Enumerations
 are type compatible with numeric variables, so their constants are 
always assigned an integer numerical value internally. If it is not 
specified, the integer value equivalent to the first possible value is 
equivalent to 0 and the following ones follow a +1 progression.&lt;/span&gt;&lt;span style=&quot;background-color: #f4cccc; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Thus,
 in our data type colors_t that we have defined above, black would be 
equivalent to 0, blue would be equivalent to 1, green to 2, and so on.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;We
 can explicitly specify an integer value for any of the constant values 
that our enumerated type can take. If the constant value that follows it
 is not given an integer value, it is automatically assumed the same 
value as the previous one plus one. For example:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;24&quot;&gt;&lt;/col&gt;&lt;col width=&quot;600&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;enum months_t { january=1, february, march, april, may, june, july, august, september, october, november, december} y2k;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In
 this case, variable y2k of enumerated type months_t can contain any of 
the 12 possible values that go from january to december and that are 
equivalent to values between 1 and 12 (not between 0 and 11, since we 
have made january equal to 1).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Unions&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Unions
 allow one same portion of memory to be accessed as different data 
types, since all of them are in fact the same location in memory. Its 
declaration and use is similar to the one of structures but its 
functionality is totally different:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;union union_name {&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;member_type1 member_name1;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;member_type2 member_name2;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;member_type3 member_name3;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;.&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;.&lt;br class=&quot;kix-line-break&quot; /&gt;} object_names;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;All
 the elements of the union declaration occupy the same physical space in
 memory. Its size is the one of the greatest element of the declaration.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; For example:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;24&quot;&gt;&lt;/col&gt;&lt;col width=&quot;600&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;union mytypes_t {&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;char c;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;int i;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;float f;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;} mytypes;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;defines three elements:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;24&quot;&gt;&lt;/col&gt;&lt;col width=&quot;600&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: #ccffff; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;mytypes.c&lt;br class=&quot;kix-line-break&quot; /&gt;mytypes.i&lt;br class=&quot;kix-line-break&quot; /&gt;mytypes.f&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;each one with a different data type. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Since
 all of them are referring to the same location in memory, the 
modification of one of the elements will affect the value of all of 
them. We cannot store different values in them independent of each 
other.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;5&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;What is virtual function?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 16 Mar 2011(005)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Source &amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.codersource.net/C/CTutorials/VirtualFunctionsinC.aspx&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.codersource.net/C/CTutorials/VirtualFunctionsinC.aspx&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Virtual Functions&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 4pt; margin-top: 18pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is a Virtual Function?&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A
 virtual function is a member function of a class, whose functionality 
can be over-ridden in its derived classes. It is one that is declared as
 virtual in the base class using the virtual keyword. The virtual nature
 is inherited in the subsequent derived classes and the virtual keyword 
need not be re-stated there.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; The whole function body can be replaced with a new set of implementation in the derived class.&lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Binding?&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Binding
 refers to the act of associating an object or a class with its member. 
If we can call a method fn() on an object O of a class C, we say that 
the object O is binded with the method fn(). This happens at compile 
time and is known as &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;static or compile - time binding&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. The calls to the virtual member functions are resolved during run-time. This mechanism is known as &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dynamic binding&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.
 The most prominent reason why a virtual function will be used is to 
have a different functionality in the derived class. The difference 
between a non-virtual member function and a virtual member function is, 
the non-virtual member functions are resolved at compile time.&lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;How does a Virtual Function work?&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Whenever a program has a virtual function declared, a &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;V - table is constructed for the class&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.
 The v-table consists of addresses to the virtual functions for classes 
that contain one or more virtual functions. The object of the class 
containing the virtual function contains a virtual pointer that points 
to the base address of the virtual table in memory. Whenever there is a 
virtual function call, the v-table is used to resolve to the function 
address. An object of the class that contains one or more virtual 
functions contains a virtual pointer called the vptr at the very 
beginning of the object in the memory. Hence the size of the object in 
this case increases by the size of the pointer. This vptr contains the 
base address of the virtual table in memory. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Note
 that virtual tables are class specific, i.e., there is only one virtual
 table for a class irrespective of the number of virtual functions it 
contains.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 This virtual table in turn contains the base addresses of one or more 
virtual functions of the class. At the time when a virtual function is 
called on an object, the vptr of that object provides the base address 
of the virtual table for that class in memory. This table is used to 
resolve the function call as it contains the addresses of all the 
virtual functions of that class. This is how dynamic binding is resolved
 during a virtual function call.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 following code shows how we can write a virtual function in C++ and 
then use the same to achieve dynamic or runtime polymorphism.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include &lt;iostream .h=&quot;&quot;&gt;&lt;/iostream&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class base&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;virtual void display()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;cout&amp;lt;&amp;lt;”\nBase”;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class derived : public base&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;void display()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; cout&amp;lt;&amp;lt;”\nDerived”;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void main()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;base *ptr = new derived();&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;ptr-&amp;gt;display();&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In
 the above example, the pointer is of type base but it points to the 
derived class object. The method display() is virtual in nature. Hence 
in order to resolve the virtual method call, the context of the pointer 
is considered, i.e., the display method of the derived class is called 
and not that of the base. If the method was non virtual in nature, the 
display() method of the base class would have been called.&lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Virtual Constructors and Destructors&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A constructor &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;cannot be virtual&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; because at the time when the constructor is invoked the virtual table would not be available in the memory.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; Hence we cannot have a virtual constructor.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A
 virtual destructor is one that is declared as virtual in the base class
 and is used to ensure that destructors are called in the proper order. 
It is to be remembered that destructors are called in the reverse order 
of inheritance. If a base class pointer points to a derived class object
 and we some time later use the delete operator to delete the object, 
then the derived class destructor is not called. Refer to the code that 
follows:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include &lt;iostream .h=&quot;&quot;&gt;&lt;/iostream&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class base&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;~base()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class derived : public base&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;~derived()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void main()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;base *ptr = new derived();&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// some code&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;delete ptr;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In
 this case the type of the pointer would be considered. Hence as the 
pointer is of type base, the base class destructor would be called but 
the derived class destructor would not be called at all. The result is 
memory leak. In order to avoid this, we have to make the destructor 
virtual in the base class. This is shown in the example below:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include &lt;iostream .h=&quot;&quot;&gt;&lt;/iostream&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class base&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;virtual ~base()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class derived : public base&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;~derived()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void main()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;base *ptr = new derived();&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// some code&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;delete ptr;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Conclusion:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Virtual
 methods should be used judiciously as they are slow due to the overhead
 involved in searching the virtual table. They also increase the size of
 an object of a class by the size of a pointer. The size of a pointer 
depends on the size of an integer. Note that in DOS based systems the 
size of a pointer is 2 bytes whereas in UNIX based systems it is 4 
bytes.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;6&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is deep copy shallow copy difference?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 16 Mar 2011(004)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: red; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Source&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.fredosaurus.com/notes-cpp/oop-classes/oopterms.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.fredosaurus.com/notes-cpp/oop-classes/oopterms.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;C++ Notes: Shallow vs Deep Copies&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;shallow copy&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 of an object copies all of the member field values. This works well if 
the fields are values, but may not be what you want for fields that 
point to dynamically allocated memory. The pointer will be copied. but 
the memory it points to will not be copied -- the field in both the 
original object and the copy will then point to the same dynamically 
allocated memory, which is not usually what you want. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The default copy constructor and assignment operator make shallow copies.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;deep copy&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; copies all fields, &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; makes copies of dynamically allocated memory pointed to by the fields. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;To make a deep copy, you must write a copy constructor and overload the assignment operator&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;, otherwise the copy will point to the original, with disastrous consequences.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Deep copies need ...&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;If
 an object has pointers to dynamically allocated memory, and the 
dynamically allocated memory needs to be copied when the original object
 is copied, then a deep copy is required.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A class that requires deep copies generally needs:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A&lt;/span&gt;&lt;a href=&quot;http://www.fredosaurus.com/notes-cpp/oop-condestructors/constructors.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;constructor&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; to either make an initial allocation or set the pointer to NULL.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A&lt;/span&gt;&lt;a href=&quot;http://www.fredosaurus.com/notes-cpp/oop-condestructors/destructors.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;destructor&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; to delete the dynamically allocated memory.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A&lt;/span&gt;&lt;a href=&quot;http://www.fredosaurus.com/notes-cpp/oop-condestructors/copyconstructors.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;copy constructor&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; to make a copy of the dynamically allocated memory.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;An&lt;/span&gt;&lt;a href=&quot;http://www.fredosaurus.com/notes-cpp/oop-overloading/overloadassign.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;overloaded assignment operator&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; to make a copy of the dynamically allocated memory.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class Vector&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Vector() { x = 0; y = 0; } // Standard constructor&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Vector(const Vector&amp;amp; other) // &lt;/span&gt;&lt;span style=&quot;background-color: lime; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Copy constructor&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x = other.x;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y = other.y;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Vector&amp;amp; operator=(const Vector&amp;amp; other) // &lt;/span&gt;&lt;span style=&quot;background-color: lime; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Assignment operator&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x = other.x;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y = other.y;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return *this;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// [Other member functions needed to make class useful]&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;private:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;int x, y;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void foo(Vector v)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// [Some code here]&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void bar()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Vector v1; // v1 will be constructed by the standard constructor&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;foo(v1); // The copy constructor will be used to create a copy of v1&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Vector v2 = v1; // v2 will typically be constructed by the copy constructor&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Vector v3;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;v3 = v1; // The assignment operator will be used here&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;7&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is friend function(also write a program )?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 10 Mar 2011(003)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.cprogramming.com/tutorial/friends.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.cprogramming.com/tutorial/friends.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.java2s.com/Tutorial/Cpp/0180__Class/FriendClasses.htm&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.java2s.com/Tutorial/Cpp/0180__Class/FriendClasses.htm&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Friend Functions and Friend Classes&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;It
 is often useful for one class to see the private variables of another 
class, even though these variables should probably not be made part of 
the public interface that the class supports. For instance, if you were 
writing a binary tree, you might want to use a Node class that has 
private data, but it would still be convenient for the functions that 
actually combine nodes together to be able to access the data directly 
without having to work through the Node interface. At times, it may not 
even be appropriate for an accessor function to ever give even indirect 
access to the data.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Friend Classes&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;C++
 provides the friend keyword to do just this. Inside a class, you can 
indicate that other classes (or simply functions) will have direct 
access to protected and private members of the class. When granting 
access to a class, you must specify that the access is granted for a 
class using the class keyword:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;friend class aClass;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Note
 that friend declarations can go in either the public, private, or 
protected section of a class--it doesn&#39;t matter where they appear.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 In particular, specifying a friend in the section marked protected 
doesn&#39;t prevent the friend from also accessing private fields. Here is a
 more concrete example of declaring a friend:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class Node&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;private:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;int data;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;int key;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// ...&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;friend class BinaryTree; // class BinaryTree can now access data directly&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Now,
 Node does not need to provide any means of accessing the data stored in
 the tree. The BinaryTree class that will use the data is the only class
 that will ever need access to the data or key. (The BinaryTree class 
needs to use the key to order the tree, and it will be the gateway 
through which other classes can access data stored in any particular 
node.) Now in the BinaryTree class, you can treat the key and data 
fields as though they were public:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class BinaryTree&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;private:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Node *root;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;int find(int key);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int BinaryTree::find(int key)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// check root for NULL...&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;if(root-&amp;gt;key == key)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// no need to go through an accessor function&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return root-&amp;gt;data;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// perform rest of find&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Friend Functions&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Similarly,
 a class can grant access to its internal variables on a more selective 
basis--for instance, restricting access to only a single function. To do
 so, &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;the
 entire function signature must be replicated after the friend 
specifier, including the return type of the function--and, of course, 
you&#39;ll need to give the scope of the function if it&#39;s inside another 
class:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #f1c232; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;friend return_type class_name::function(args);&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;For instance, in our example Node class, we would use this syntax:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class Node&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;private:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;int data;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;int key;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;// ...&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;friend int BinaryTree::find(); // Only BinaryTree&#39;s find function has access&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Now
 the find function of BinaryTree could access the internals of the Node 
class, but no other function in BinaryTree could. (Though we might want a
 few others to be able to!) Note that when friends are specified within a
 class, this does not give the class itself access to the friend 
function. That function is not within the scope of the class; it&#39;s only 
an indication that the class will grant access to the function.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;friend and Encapsulation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Some
 people believe that the idea of having friend classes violates the 
principle of encapsulation because it means that one class can get at 
the internals of another. One way to think about this, however, is that 
friend is simply part of a class&#39;s overall interface that it shows the 
world. Just like an elevator repairman has access to a different 
interface than an elevator rider, some classes or functions require 
expanded access to the internals of another class. Moreover, using 
friend allows a class to present a more restrictive interface to the 
outside world by hiding more details than may be needed by anything but 
the friends of the class. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Finally,
 friends are particularly common in cases of operator overloading 
because it is often necessary for an overloaded operator to have access 
to the internals of the classes that are arguments to the operator.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;8&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Type-casting?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 12 Jan 2011(001)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.cplusplus.com/doc/tutorial/typecasting/&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.cplusplus.com/doc/tutorial/typecasting/&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Type Casting&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 32px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Converting an expression of a given type into another type is known as &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;type-casting&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Implicit conversion&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Implicit
 conversions do not require any operator. They are automatically 
performed when a value is copied to a compatible type. For example:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;short a=2000;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int b;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;b=a;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Explicit conversion&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 19px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;C++
 is a strong-typed language. Many conversions, specially those that 
imply a different interpretation of the value, require an explicit 
conversion. We have already seen two notations for explicit type 
conversion: functional and c-like casting:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;short a=2000;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int b;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;b = (int) a; // c-like cast notation&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;b = int (a); // functional notation&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 functionality of these explicit conversion operators is enough for most
 needs with fundamental data types. However, these operators can be 
applied indiscriminately on classes and pointers to classes, which can 
lead to code that while being syntactically correct can cause runtime 
errors. For example, the following code is syntactically correct:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In
 order to control these types of conversions between classes, we have 
four specific casting operators: dynamic_cast, reinterpret_cast, 
static_cast and const_cast. Their format is to follow the new type 
enclosed between angle-brackets (&amp;lt;&amp;gt;) and immediately after, the 
expression to be converted between parentheses.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dynamic_cast &lt;new_type&gt; (expression)&lt;/new_type&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;reinterpret_cast &lt;new_type&gt; (expression)&lt;/new_type&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;static_cast &lt;new_type&gt; (expression)&lt;/new_type&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const_cast &lt;new_type&gt; (expression)&lt;/new_type&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The traditional type-casting equivalents to these expressions would be:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;(new_type) expression&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;new_type (expression)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;but each one with its own special characteristics:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;dynamic_cast&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 19px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dynamic_cast can be used only with pointers and references to objects.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; Its purpose is to ensure that the result of the type conversion is a valid complete object of the requested class.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Therefore, &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dynamic_cast is always successful when we cast a class to one of its base classes:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #f1c232; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class CBase { };&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class CDerived: public CBase { };&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;CBase b; CBase* pb;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;CDerived d; CDerived* pd;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;pb = dynamic_cast&lt;cbase&gt;(&amp;amp;d); // &lt;/cbase&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ok: derived-to-base&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;pd = dynamic_cast&lt;cderived&gt;(&amp;amp;b); // &lt;/cderived&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;wrong: base-to-derived&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 second conversion in this piece of code would produce a compilation 
error since base-to-derived conversions are not allowed with 
dynamic_cast unless the base class is polymorphic.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;contd...&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;9&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;what is singleton class(and how will u write this)?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 28 Mar 2011(005)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://en.wikibooks.org/wiki/C%2B%2B_Programming/Code/Design_Patterns&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://en.wikibooks.org/wiki/C%2B%2B_Programming/Code/Design_Patterns&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Singleton&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The term Singleton refers to an &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;object that can only be instantiated once&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.
 This pattern is generally used where a global variable would have 
otherwise been used. The main advantage of the singleton is that its 
existence is guaranteed. Other advantages of the design pattern include 
the clarity, from the unique access, that the object used is not on the 
local stack. Some of the downfalls of the object include that, like a 
global variable, it can be hard to tell what chunk of code corrupted 
memory, when a bug is found, since everyone has access to it.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffffdd; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Let&#39;s take a look at how a Singleton differs from other variable types.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Like
 a global variable, the Singleton exists outside of the scope of any 
functions. Traditional implementation uses a static member function of 
the Singleton class, which will create a single instance of the 
Singleton class on the first call, and forever return that instance. The
 following code example illustrates the elements of a C++ singleton 
class, that simply stores a single string.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class StringSingleton&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// Some accessor functions for the class, itself&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;std::string GetString() const&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{return mString;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void SetString(const std::string &amp;amp;newStr)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{mString = newStr;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// The magic function, which allows access to the class from anywhere&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// To get the value of the instance of the class, call:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// StringSingleton::Instance().GetString();&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;static &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;StringSingleton &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;amp;Instance()&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// This line only runs once, thus creating the only instance in existence&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;static StringSingleton *instance = new StringSingleton;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// dereferencing the variable here, saves the caller from having to use &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// the arrow operator, and removes tempation to try and delete the &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// returned instance.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;return *instance; // always returns the same instance&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;private:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// We need to make some given functions private to finish the definition of the singleton&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;StringSingleton(){} &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;default constructor&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; available only to members or friends of this class&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// Note that the next two functions are not given bodies, thus any attempt &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// to call them implicitly will return as compiler errors. This prevents &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// accidental copying of the only instance of the class.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;StringSingleton(const StringSingleton &amp;amp;old); &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// disallow &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;copy constructor&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const StringSingleton &amp;amp;operator=(const StringSingleton &amp;amp;old); &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;//disallow &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;assignment operator&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// Note that although this should be allowed, &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// some compilers may not implement private destructors&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// This prevents others from deleting our one single instance, which was otherwise created on the heap&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;~StringSingleton(){}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;private: // private data for an instance of this class&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;std::string mString;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;10&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;whats a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;preprocessor &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;in c?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 20 Dec 2010(002)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.cplusplus.com/&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;www.cplusplus.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Preprocessor
 directives are lines included in the code of our programs that are not 
program statements but directives for the preprocessor. These lines are 
always preceded by a hash sign (#). The preprocessor is executed before 
the actual compilation of code begins, therefore the preprocessor 
digests all these directives before any code is generated by the 
statements.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;These
 preprocessor directives extend only across a single line of code. As 
soon as a newline character is found, the preprocessor directive is 
considered to end. No semicolon (;) is expected at the end of a 
preprocessor directive. The only way a preprocessor directive can extend
 through more than one line is by preceding the newline character at the
 end of the line by a backslash (\).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;macro definitions (#define, #undef)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Conditional inclusions (#ifdef, #ifndef, #if, #endif, #else and #elif)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Line control (#line)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Error directive (#error)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Source file inclusion (#include)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Pragma directive (#pragma)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;11&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;what are all Program compilation steps in c language?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 20 Dec 2010(002)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.cprogramming.com/compilingandlinking.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.cprogramming.com/compilingandlinking.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When
 programmers talk about creating programs, they often say, &quot;it compiles 
fine&quot; or, when asked if the program works, &quot;let&#39;s compile it and see&quot;. 
This colloquial usage might later be a source of confusion for new 
programmers. Compiling isn&#39;t quite the same as creating an executable 
file! Instead, creating an executable is a multistage process divided 
into two components: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;compilation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;linking&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.
 In reality, even if a program &quot;compiles fine&quot; it might not actually 
work because of errors during the linking phase. The total process of 
going from source code files to an executable might better be referred 
to as a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Compilation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Compilation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 refers to the processing of source code files (.c, .cc, or .cpp) and 
the creation of an &#39;object&#39; file. This step doesn&#39;t create anything the 
user can actually run. Instead, the compiler merely produces the machine
 language instructions that correspond to the source code file that was 
compiled. For instance, if you compile (but don&#39;t link) three separate 
files, you will have three object files created as output, each with the
 name &lt;filename&gt;.o or &lt;filename&gt;.obj (the extension will 
depend on your compiler). Each of these files contains a translation of 
your source code file into a machine language file -- but you can&#39;t run 
them yet! You need to turn them into executables your operating system 
can use. That&#39;s where the linker comes in.&lt;/filename&gt;&lt;/filename&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Linking&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Linking&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 refers to the creation of a single executable file from multiple object
 files. In this step, it is common that the linker will complain about 
undefined functions (commonly, main itself). During compilation, if the 
compiler could not find the definition for a particular function, it 
would just assume that the function was defined in another file. If this
 isn&#39;t the case, there&#39;s no way the compiler would know -- it doesn&#39;t 
look at the contents of more than one file at a time. The linker, on the
 other hand, may look at multiple files and try to find references for 
the functions that weren&#39;t mentioned.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;You
 might ask why there are separate compilation and linking steps. First, 
it&#39;s probably easier to implement things that way. The compiler does its
 thing, and the linker does its thing -- by keeping the functions 
separate, the complexity of the program is reduced. Another (more 
obvious) advantage is that this allows the creation of large programs 
without having to redo the compilation step every time a file is 
changed. Instead, using so called &quot;conditional compilation&quot;, it is 
necessary to compile only those source files that have changed; for the 
rest, the object files are sufficient input for the linker. Finally, 
this makes it simple to implement libraries of pre-compiled code: just 
create object files and link them just like any other object file. (The 
fact that each file is compiled separately from information contained in
 other files, incidentally, is called the &quot;separate compilation model&quot;.)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;To
 get the full benefits of condition compilation, it&#39;s probably easier to
 get a program to help you than to try and remember which files you&#39;ve 
changed since you last compiled. (You could, of course, just recompile 
every file that has a timestamp greater than the timestamp of the 
corresponding object file.) If you&#39;re working with an integrated 
development environment (IDE) it may already take care of this for you. 
If you&#39;re using command line tools, there&#39;s a nifty utility called&lt;/span&gt;&lt;a href=&quot;http://www.gnu.org/software/make/make.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;make&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 that comes with most *nix distributions. Along with conditional 
compilation, it has several other nice features for programming, such as
 allowing different compilations of your program -- for instance, if you
 have a version producing verbose output for debugging.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Knowing
 the difference between the compilation phase and the link phase can 
make it easier to hunt for bugs. Compiler errors are usually syntactic 
in nature -- a missing semicolon, an extra parenthesis. Linking errors 
usually have to do with missing or multiple definitions. If you get an 
error that a function or variable is defined multiple times from the 
linker, that&#39;s a good indication that the error is that two of your 
source code files have the same function or variable. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.acm.uiuc.edu/sigmil/RevEng/ch02.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.acm.uiuc.edu/sigmil/RevEng/ch02.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;The compilation Process&lt;/span&gt;&lt;img height=&quot;166px;&quot; src=&quot;https://lh5.googleusercontent.com/eDa1PSYDkI4EcvfmryDEpfql1i-Pm5161JdaGHcrgzdW-U4-Tn5xhC--hQJiqtDcaKtkgkCHyseNiX2DLnnPiRafvFjWgZle47ZV7R4zyFBzWqOtyyg&quot; width=&quot;640px;&quot; /&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;All
 5 stages are implemented by one program in UNIX, namely cc, or in our 
case, gcc (or g++). The general order of things goes gcc -&amp;gt; gcc -E 
-&amp;gt; gcc -S -&amp;gt; as -&amp;gt; ld. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;12&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Wild pointer and Dangling Pointer?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(004)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Dangling_pointer&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://en.wikipedia.org/wiki/Dangling_pointer&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dp &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; NULL&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* ... */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; c&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dp &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* c falls out of scope */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* dp is now a dangling pointer */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include &lt;stdlib .h=&quot;&quot;&gt;&lt;/stdlib&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; func&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dp &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; malloc&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A_CONST&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* ... */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;free&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dp&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* dp now becomes a dangling pointer */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;dp &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; NULL&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* dp is no longer dangling */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* ... */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; num &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #0000dd; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1234&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* ... */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #b1b100; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;num&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; f&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;dp&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* dp is a &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;wild pointer&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*/&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #993333; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;scp&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #339933; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: grey; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;/* scp is not a wild pointer:&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* static variables are initialized to 0&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* at start and retain their values from&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* the last call afterwards.&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Using this feature may be considered bad&lt;br class=&quot;kix-line-break&quot; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* style if not commented */&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #009900; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;13&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Explain the scope resolution operator?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(002)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Scope_resolution_operator&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://en.wikipedia.org/wiki/Scope_resolution_operator&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;scope resolution operator&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 (::) in C++ is used to define the already declared member functions (in
 the header file with the .hpp or the .h extension) of a particular 
class. In the .cpp file one can define the usual global functions or the
 member functions of the class. To differentiate between the normal 
functions and the member functions of the class, one needs to use the 
scope resolution operator (::) in between the class name and the member 
function name i.e. ship::foo() where ship is a class and foo() is a 
member function of the class ship.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 other uses of the resolution operator is to resolve the scope of a 
variable when the same identifier is used to represent a global 
variable, a local variable, and members of one or more class(es).&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 If the resolution operator is placed between the class name and the 
data member belonging to the class then the data name belonging to the 
particular class is referenced.&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; If the resolution operator is placed in front of the variable name then the global variable is referenced.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; When no resolution operator is placed then the local variable is referenced.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include &lt;iostream&gt;&lt;/iostream&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;using namespace std;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int n = 12; // A global variable&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int main() {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; int n = 13; // A local variable&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; cout &amp;lt;&amp;lt; &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;::n &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;lt;&amp;lt; endl; // Print the global variable: 12&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; cout &amp;lt;&amp;lt; n &amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt; endl; // Print the local variable: 13&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;14&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is structure and class difference?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.parashift.com/c++-faq-lite/classes-and-objects.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.parashift.com/c++-faq-lite/classes-and-objects.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 members and base classes of a struct are public by default, while in 
class, they default to private. Note: you should make your base classes &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;explicitly&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; public, private, or protected, rather than relying on the defaults.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;struct and class are otherwise functionally equivalent.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;OK,
 enough of that squeaky clean techno talk. Emotionally, most developers 
make a strong distinction between a class and a struct. A struct simply &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;feels&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; like an open pile of bits with very little in the way of encapsulation or functionality. A class &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;feels&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 like a living and responsible member of society with intelligent 
services, a strong encapsulation barrier, and a well defined interface. 
Since that&#39;s the connotation most people already have, you should 
probably use the struct keyword if you have a class that has very few 
methods and has public data (such things &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;do&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; exist in well designed systems!), but otherwise you should probably use the class keyword.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;15&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Can a structure contain a pointer to itself ?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(005)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://c-faq.com/struct/selfref.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://c-faq.com/struct/selfref.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Most certainly. A problem can arise if you try to use typedefs;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;16&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;XXX?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;15)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What&#39;s the difference between using a typedef or a #define for a user-defined type? &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(003)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://c-faq.com/decl/typedefvsdefine.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://c-faq.com/decl/typedefvsdefine.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In
 general, typedefs are preferred, in part because they can correctly 
encode pointer types. For example, consider these declarations:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typedef char *String_t;&lt;br class=&quot;kix-line-break&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define String_d char *&lt;br class=&quot;kix-line-break&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String_t s1, s2;&lt;br class=&quot;kix-line-break&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String_d s3, s4;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;s1, s2, and s3 are all declared as char *, but s4 is declared as a char, which is probably not the intention. (See also question&lt;/span&gt;&lt;a href=&quot;http://c-faq.com/decl/charstarws.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;1.5&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#defines do have the advantage that #ifdef works on them (see also question&lt;/span&gt;&lt;a href=&quot;http://c-faq.com/cpp/iftypedef.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;10.15&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;).
 On the other hand, typedefs have the advantage that they obey scope 
rules (that is, they can be declared local to a function or block).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;17&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Polymorphism?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(002)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.exforsys.com/tutorials/c-plus-plus/polymorphism-an-introduction.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.exforsys.com/tutorials/c-plus-plus/polymorphism-an-introduction.html&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Polymorphism
 is the ability to use an operator or function in different ways. 
Polymorphism gives different meanings or functions to the operators or 
functions. Poly, referring to many, signifies the many uses of these 
operators and functions. A single function usage or an operator 
functioning in many ways can be called polymorphism. Polymorphism refers
 to codes, operations or objects that behave differently in different 
contexts.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Polymorphism
 is a powerful feature of the object oriented programming language C++. A
 single operator + behaves differently in different contexts such as 
integer, float or strings referring the concept of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;polymorphism&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. The above concept leads to operator &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;overloading&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. The concept of overloading is also a branch of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;polymorphism&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. When the exiting operator or function operates on new data type it is &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;overloaded&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. This feature of polymorphism leads to the concept of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;virtual methods&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Polymorphism
 refers to the ability to call different functions by using only one 
type of function call. &amp;nbsp;Suppose a programmer wants to code vehicles of 
different shapes such as circles, squares, rectangles, etc. One way to 
define each of these classes is to have a member function for each that 
makes vehicles of each shape. Another convenient approach the programmer
 can take is to define a base class named Shape and then create an 
instance of that class. The programmer can have array that hold pointers
 to all different objects of the vehicle followed by a simple loop 
structure to make the vehicle, as per the shape desired, by inserting 
pointers into the defined array. This approach leads to different 
functions executed by the same function call. Polymorphism is used to 
give different meanings to the same concept. This is the basis for &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Virtual function&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; implementation.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In
 polymorphism, a single function or an operator functioning in many ways
 depends upon the usage to function properly. In order for this to 
occur, the following conditions must apply:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;All
 different classes must be derived from a single base class. In the 
above example, the shapes of vehicles (circle, triangle, rectangle) are 
from the single base class called Shape.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 member function must be declared virtual in the base class. In the 
above example, the member function for making the vehicle should be made
 as virtual to the base class.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #ff3300; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Applications are Easily Extendable:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Once
 an application is written using the concept of polymorphism, it can 
easily be extended, providing new objects that conform to the original 
interface. It is unnecessary to recompile original programs by adding 
new types. Only re-linking is necessary to exhibit the new changes along
 with the old application. This is the greatest achievement of C++ 
object-oriented programming. In programming language, there has always 
been a need for adding and customizing. By utilizing the concept of 
polymorphism, time and work effort is reduced in addition to making 
future maintenance easier.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Helps in reusability of code.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Provides easier maintenance of applications.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Helps in achieving robustness in applications.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Types of Polymorphism:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;C++ provides three different types of polymorphism.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Virtual functions&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Function name overloading&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Operator overloading&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In addition to the above three types of polymorphism, there exist other kinds of polymorphism:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;run-time&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;compile-time&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ad-hoc polymorphism&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;parametric polymorphism&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Other types of polymorphism defined:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #ff3300; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;run-time:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;run-time &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;polymorphism is implemented with &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;inheritance &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;and &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;virtual functions.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #ff3300; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;compile-time:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;compile-time&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; polymorphism is implemented with &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;templates&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #ff3300; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ad-hoc polymorphism:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;If
 the range of actual types that can be used is finite and the 
combinations must be individually specified prior to use, this is called
 &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;ad-hoc&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; polymorphism.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #ff3300; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;parametric polymorphism:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;If
 all code is written without mention of any specific type and thus can 
be used transparently with any number of new types it is called &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;parametric&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; polymorphism.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In general, there are two main categories of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Polymorphism &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;namely&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Ad Hoc Polymorphism&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Pure Polymorphism&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #990000; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Overloading concepts &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;fall under the category of &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Ad Hoc Polymorphism&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;and &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Virtual methods&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. Templates or parametric classes fall under the category of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Pure Polymorphism&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;18&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is the semantics of data?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 12 Mar 2011(001)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;If we have an empty class&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class X ;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Her size is 1 byte, because the compiler insert a char. If we now have the next sentences:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class Y : public virtual X ;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class Z : publicvirtual X ;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class A : public Y, public Z ;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 size for both classes Y and Z is 8. This size is partially machine 
dependent. It is also dependent in part of the compiler implementation 
being used. The size, in both classes (Y and Z) is the interplay of 
three factors:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1.-
 Language support overhead. There is an associated overhead incurred in 
the language support of virtual base classes. Within the derived class, 
this overhead is reflected as some form of pointer (4 bytes).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2.-
 Compiler Optimization of recognized special cases. There is the 1 byte 
size of the virtual base class X subobject also present within Y and Z.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3.-
 Alignment constraints. The size of the classes at in this point is 5 
bytes. On most of the machines aggregate structures have an alignment 
constraint so that they can be efficiently loaded from and stored to 
memory. Classes Y and Z requires 3 bytes of padding.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The result is a final size of 8.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The size of the class A is determined by the following:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;* The size of the single shared instance of class X: 1 byte.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;* The size of its base classes Y and Z minus the storage allocated for class X : 4 bytes each (8 bytes total).&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;* The size of class A itself : 0 bytes.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;* Class A must align on 4 bytes boundary, thus it requires 3 bytes of padding. This results in a total size of 12 bytes.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;19&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is composition?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(002)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;https://docs.google.com/viewer?a=v&amp;amp;pid=explorer&amp;amp;chrome=true&amp;amp;srcid=0B5G4itY9P9sfY2Q2MzQ0OGQtNTljZi00NzUzLWI5YTAtMTM4YjkwOWU5MWYx&amp;amp;hl=en&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;https://docs.google.com/viewer?a=v&amp;amp;pid=explorer&amp;amp;chrome=true&amp;amp;srcid=0B5G4itY9P9sfY2Q2MzQ0OGQtNTljZi00NzUzLWI5YTAtMTM4YjkwOWU5MWYx&amp;amp;hl=en&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 simplest way to reuse a class is to just use an object of that class 
directly, but you can also place an object of that class inside a new 
class. We call this “creating a member object.” Your new class can&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;be
 made up of any number and type of other objects, in any combination 
that you need to achieve the functionality desired in your new class. 
Because you are composing a new class from existing classes, this 
concept is called &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;composition &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;(or more generally, &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;aggregation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;). &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Composition is often referred to as a “has-a” relationship, as in “a car has an engine.”&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Composition
 comes with a great deal of flexibility. The member objects of your new 
class are usually private, making them inaccessible to the client 
programmers who are using the class. This allows you to change those 
members without disturbing existing client code. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;You
 can also change the member objects at runtime, to dynamically change 
the behavior of your program. Inheritance, which is described next, does
 not have this flexibility since the compiler must place compile-time 
restrictions on classes created&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;with inheritance.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol start=&quot;20&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Function Overloading?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(003)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Function overloading is the practice of declaring the same function with different signatures&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. The same function name will be used with different number of parameters and parameters of different type. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;But overloading of functions with different return types are not allowed&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;For example in this C++ Tutorial let us assume an AddAndDisplay function with different types of parameters.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff99; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;//C++ Tutorial - Sample code for function overloading&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void AddAndDisplay(int x, int y)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout&amp;lt;&amp;lt;&quot; C++ Tutorial - Integer result: &quot;&amp;lt;&amp;lt;(x+y);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void AddAndDisplay(double x, double y)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout&amp;lt;&amp;lt; &quot; C++ Tutorial - Double result: &quot;&amp;lt;&amp;lt;(x+y);&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void AddAndDisplay(float x, float y)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout&amp;lt;&amp;lt; &quot; C++ Tutorial - float result: &quot;&amp;lt;&amp;lt;(x+y);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Some
 times when these overloaded functions are called, they might cause 
ambiguity errors. This is because the compiler may not be able to decide
 what signature function should be called.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;If
 the data is type cast properly, then these errors will be resolved 
easily. Typically, function overloading is used wherever a different 
type of data is to be dealt with. For example this can be used for a 
function which converts farenheit to celsius and vice versa. One of the 
functions can deal with the integer data, other can deal float for 
precision etc.,&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;21&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is “this pointer”??&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(003)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.codersource.net/C/CTutorials/CTutorialthispointer.aspx&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.codersource.net/C/CTutorials/CTutorialthispointer.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The this pointer is used as a pointer to the&lt;/span&gt;&lt;a href=&quot;http://www.codersource.net/cpp_tutorial_class.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;
 object instance by the member function. The address of the class 
instance is passed as an implicit parameter to the member functions. The
 sample below, in this c++ Tutorial shows how to use it. It is a common 
knowledge that C++ keeps only one copy of each member function and the 
data members are allocated memory for all of their instances. This kind 
of various instances of data are maintained use this pointer. Look at 
the sample below, in this c++ Tutorial.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;C++ Tutorial - important notes on this pointer:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;this
 pointer stores the address of the class instance, to enable pointer 
access of the members to the member functions of the class.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;this pointer is not counted for calculating the size of the object.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;this pointers are not accessible for static member functions.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;this pointers are not modifiable. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Look at the following example to understand how to use the &#39;this&#39; pointer explained in this C++ Tutorial. &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class this_pointer_example // class for explaining C++ tutorial &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int data1;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Function using this pointer for C++ Tutorial&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int getdata()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this-&amp;gt;data1;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Function without using this pointer &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void setdata(int newval)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data1 = newval;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;Thus, a member function can gain the access of data member by either using this pointer or not.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;22&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What do know about “Const Data” “Const pointer”?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(005)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 19px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;CONSTANT KEYWORD&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char *p &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &quot;Hello&quot;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// non-const pointer, non-const data&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char *p &amp;nbsp;= &quot;Hello&quot;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// non-const pointer, const data&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char * const p = &quot;Hello&quot;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// const pointer non-const data&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char * const p = &quot;Hello&quot;;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;// const pointer, const data&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;I have this explanation I wrote a long time ago stored away in a file, so to elaborate:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;This file explains how const works.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The following declarations are &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;identical&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char* p;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char const* p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Both
 declare a pointer to a constant character. The second is slightly 
better in the sense that the declaration can be read from right-to-left:
 &quot;p is a pointer to a const char&quot;. Read as such, it is easy to see that 
the line *p = &#39;c&#39;; will not compile.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The following declaration:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char* const p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;declares p to be a constant pointer to a character. That is:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = &quot;foo&quot;; // Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = &#39;f&#39;; // Compiles!&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;And thus:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char* const p;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char const* const p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;both declare p to be a constant pointer to a constant character, and so none of the following lines of code compile:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = &quot;foo&quot;;// Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = &#39;f&#39;;// Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Now throw another pointer into the mix:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char** p;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char const** p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;These are equivalent and declare &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p to be a pointer to a pointer to a&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;constant character&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. That is:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = ptr-to-ptr-to-char; // Compiles&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = ptr-to-char; // Compiles&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;**p = &#39;f&#39;; // Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Or how about creative placement of const:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char* const* p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;This declares&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; p to be a pointer to a constant pointer to a character&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;That is:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = ptr-to-constptr-to-char; // Compiles&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = ptr-to-char; // Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = constptr-to-char; // Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;**p = &#39;f&#39;; // Compiles&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;And the ever-popular:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;char** const p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Which declares p to be a constant pointer to a pointer to a character.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Or:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = ptr-to-ptr-to-char; // Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = constptr-to-ptr-to-char; // Does not compile&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = ptr-to-char; // Compiles&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;**p = &#39;f&#39;; // Compiles&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;And now we get just plain const happy:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char* const* p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p is a pointer to a constant pointer to a constant character. The only&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;thing you can do with this one (besides remove the code and rewrite) is:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p = ptr-to-constptr-to-constchar;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char** const p;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;p is a constant pointer to a pointer to a constant character. The only thing you can do with this is:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;*p = ptr-to-constchar;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;And this beast:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;const char* const* const p;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Well,
 it won&#39;t pass code review since nobody will understand it, but at any 
rate... We&#39;ve achieved maximum constant-ness with this line. You can&#39;t 
do anything at all with p, what it points to, what that points to, or 
what &quot;what that&quot; points to. You can print it. That&#39;s about it.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;23&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What is Abstract Class?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: blue; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Last 17 Mar 2011(005)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Abstract classes (C++ only)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;at least one pure virtual function&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.
 You declare a pure virtual function by using a pure specifier &amp;nbsp;&amp;nbsp;&amp;nbsp;(= 0) 
in the declaration of a virtual member function in the class 
declaration.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class AB {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;virtual void f() = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Function AB::f is a pure virtual function. &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A function declaration cannot have both a pure specifier and a definition.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;You
 cannot use an abstract class as a parameter type, a function return 
type, or the type of an explicit conversion, nor can you declare an 
object of an abstract class. You can, however, declare pointers and 
references to an abstract class.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Virtual
 member functions are inherited. A class derived from an abstract base 
class will also be abstract unless you override each pure virtual 
function in the derived class.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;For example:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class AB {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;virtual void f() = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;class D2 : public AB {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;void g();&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int main() {&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;D2 d;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 compiler will not allow the declaration of object d because D2 is an 
abstract class; it inherited the pure virtual function f()from AB. The 
compiler will allow the declaration of object d if you define function 
D2::g().&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Note
 that you can derive an abstract class from a non-abstract class, and 
you can override a non-pure virtual function with a pure virtual 
function.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A base class containing one or more pure virtual member functions is called an abstract class.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The members of a class declared with the keyword class are private by default. A class is inherited privately by default.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The members of a class declared with the keyword struct are public by default. A structure is inherited publicly by default.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The
 members of a union (declared with the keyword union) are public by 
default. A union cannot be used as a base class in derivation.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;24&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;Operators that Cant be overloaded?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/cplusplus/cpp_overloading.htm&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.tutorialspoint.com/cplusplus/cpp_overloading.htm&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1) &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; 2) &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;.*&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; 3) &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; 4) &lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol start=&quot;25&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;&quot;&gt;What are Storage Classes in C++?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/cplusplus/cpp_storage_classes.htm&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: &#39;Times New Roman&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;http://www.tutorialspoint.com/cplusplus/cpp_storage_classes.htm&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A
 storage class defines the scope (visibility) and life time of variables
 and/or functions within a C++ Program. These specifiers precede the 
type that they modify. There are following storage classes which can be 
used in a C++ Program&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;auto&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;register&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;static&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;extern&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;mutable&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;26&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Print Odd number ?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none; width: 624px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;*&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;background-color: #ffff66; border: 1px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;#include&lt;iostream&gt;&lt;/iostream&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;using namespace std;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;int main()&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cout&amp;lt;&amp;lt; &quot;Odd Number&quot; &amp;lt;&amp;lt; endl ;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for ( int j=0; j&lt;50 j=&quot;&quot; span=&quot;&quot;&gt;&lt;!--50--&gt;&lt;/50&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;cout&amp;lt;&lt;2 j=&quot;&quot; nbsp=&quot;&quot; span=&quot;&quot;&gt;&lt;!--2--&gt;&lt;/2&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 1;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol start=&quot;27&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;XXX?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;XXX?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;XXX?&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &#39;Times New Roman&#39;; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;=====================================================================&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/2116858269507670797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/01/my-interview-questions.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2116858269507670797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/2116858269507670797'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/01/my-interview-questions.html' title='My Interview Questions'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh5.googleusercontent.com/eDa1PSYDkI4EcvfmryDEpfql1i-Pm5161JdaGHcrgzdW-U4-Tn5xhC--hQJiqtDcaKtkgkCHyseNiX2DLnnPiRafvFjWgZle47ZV7R4zyFBzWqOtyyg=s72-c" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-1097802083402223342</id><published>2011-01-10T19:32:00.001-08:00</published><updated>2011-01-10T19:32:45.167-08:00</updated><title type='text'>XML Vs. ISO</title><content type='html'>Coming Soon ...</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/1097802083402223342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/01/xml-vs-iso.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/1097802083402223342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/1097802083402223342'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/01/xml-vs-iso.html' title='XML Vs. ISO'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-9175906652090357710</id><published>2011-01-10T19:31:00.000-08:00</published><updated>2011-01-14T00:25:44.003-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Auth Authorization Capture Pre-authorization/Post-authorization Sale"/><title type='text'>Credit Card Transaction</title><content type='html'>&lt;div style=&quot;color: cyan; text-align: center;&quot;&gt;&lt;b&gt;Auth&lt;br /&gt;
Authorization&lt;br /&gt;
Capture&lt;br /&gt;
Pre-authorization/Post-authorization&lt;br /&gt;
Sale&lt;/b&gt;&lt;/div&gt;&lt;b style=&quot;background-color: black; color: white;&quot;&gt;Description&lt;/b&gt;&lt;span style=&quot;background-color: black; color: white;&quot;&gt; &lt;/span&gt;Preauthorizes and postauthorizes in one step. In the U.S., an Auth is typically used for credit card purchases that do not require physical shipment of goods or for check purchases in which the processor requires an Auth transaction. For credit card transactions, an approved Auth places a hold on the account holder&#39;s “open-to-buy” balance and the purchase is immediately ready to be  settled.&lt;br /&gt;
&lt;b style=&quot;background-color: black; color: white;&quot;&gt;What You Need to Know&lt;/b&gt; In an Auth transaction, a PreAuth and a PostAuth are performed simultaneously. In the U.S., purchases of hard goods (that is, goods that must be shipped) must go through a PreAuth and a PostAuth in two separate steps. If you must meet this requirement, use the Auth transaction type only when you transfer products electronically, that is when you deliver soft goods. Use a PreAuth and a PostAuth for purchases of hard goods.&lt;br /&gt;
No funds are transferred during a Sale. Funds are transferred when a batch is settled.&lt;br /&gt;
ref:secure-epayments.hsbc.com&lt;br /&gt;
More Coming Soon ...</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/9175906652090357710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2011/01/credit-card-transaction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/9175906652090357710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/9175906652090357710'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2011/01/credit-card-transaction.html' title='Credit Card Transaction'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3016365607685677561.post-3100703285213541238</id><published>2009-10-26T10:27:00.000-07:00</published><updated>2010-05-26T12:38:56.897-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Coding C C++"/><title type='text'>Coding</title><content type='html'>As a coder i am describing some point, that i faced at the time of coding.&lt;br /&gt;
1. Make some automation for your code, so that you can test it up-to some extend.(that will do all unit testing and can also do regression testing without help of QA people. :)).&lt;br /&gt;
And it is also easy to test and find bug in your code, as no user interaction required.&lt;br /&gt;
&lt;br /&gt;
2. Today i faced a problem in passing a array of structure in to function. my problem that i am unable to assign a integer value to element of an structure. and the reason is, i am not initializing the structure before using it ;) .&lt;br /&gt;
So moral if the story &quot;always initialize memory of all variable before using it other wise you have to fight with lots of run time or compile time bug.&quot;&lt;br /&gt;
&lt;br /&gt;
3. Make Logger which can be disable/enable compile time.&lt;br /&gt;
For this use #define .&lt;br /&gt;
This will reduce code size. And your code never crash due to logs ;) .&lt;br /&gt;
I post the Solution with complete code here... :) &lt;br /&gt;
&lt;a href=&quot;http://www.cplusplus.com/forum/general/14694/#msg78546&quot;&gt;http://www.cplusplus.com/forum/general/14694/#msg78546&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; color: #073763;&quot;&gt;&lt;code&gt;&lt;cite&gt;////////////////////////////////////////////////////////Logger.h//////////////////////////////////////////////////////&lt;/cite&gt;
&lt;dfn&gt;#define _ING_DEBUG_MODE_ 1&lt;/dfn&gt;

&lt;dfn&gt;#ifdef _ING_DEBUG_MODE_&lt;/dfn&gt;
&lt;var&gt;void&lt;/var&gt; vLogFileLine(&lt;var&gt;char&lt;/var&gt; * pchFile, &lt;var&gt;int&lt;/var&gt; inLineNumber);
&lt;var&gt;void&lt;/var&gt; vLogMessage(&lt;var&gt;char&lt;/var&gt; * pchFormat, ...);
&lt;dfn&gt;#define LOG_ING(b) { vLogFileLine(__FILE__, __LINE__ ); vLogMessage b; }&lt;/dfn&gt;
&lt;dfn&gt;#else&lt;/dfn&gt;
&lt;dfn&gt;#define LOG_ING(b)&lt;/dfn&gt;
&lt;dfn&gt;#endif&lt;/dfn&gt;




&lt;cite&gt;////////////////////////////////////////////////////////Logger.c//////////////////////////////////////////////////////&lt;/cite&gt;
&lt;dfn&gt;#ifdef _ING_DEBUG_MODE_&lt;/dfn&gt;
&lt;var&gt;void&lt;/var&gt; vLogFileLine(&lt;var&gt;char&lt;/var&gt; * pchFile, &lt;var&gt;int&lt;/var&gt; inLineNumber)
{
 &lt;var&gt;char&lt;/var&gt; FileData[100] = {&lt;kbd&gt;&quot;\0&quot;&lt;/kbd&gt;} ;
 sprintf( FileData ,&lt;kbd&gt;&quot;File-&amp;gt;%s Line-&amp;gt;%d Data-&amp;gt;&quot;&lt;/kbd&gt; , pchFile , inLineNumber ) ;
 PrintStrGB2312(FileData,FmtHalfWidthHeight);&lt;cite&gt;//Print API&lt;/cite&gt;
}
&lt;var&gt;void&lt;/var&gt; vLogMessage(&lt;var&gt;char&lt;/var&gt; * pchFormat, ...)
{
 &lt;var&gt;short&lt;/var&gt; len = 0 , i = 0;
 &lt;var&gt;char&lt;/var&gt; prnBuffer[1000] = { &lt;kbd&gt;&quot;\0&quot;&lt;/kbd&gt; };
 va_list va;
 va_start(va, pchFormat);
 vsprintf(prnBuffer, pchFormat, va);
 va_end(va);
 len = 1 + (strlen(prnBuffer) / 49) ;
 &lt;var&gt;while&lt;/var&gt;(len-- &amp;gt; 0)
  PrintStrGB2312(&amp;amp;prnBuffer[(i++)*48],FmtHalfWidthHeight);&lt;cite&gt;//Print API&lt;/cite&gt;
}
&lt;dfn&gt;#endif&lt;/dfn&gt;
&lt;cite&gt;////////////////////////////////////////////////////////main.c//////////////////////////////////////////////////////&lt;/cite&gt;
&lt;var&gt;void&lt;/var&gt; main()
{
     LOG((&lt;kbd&gt;&quot;anand rai&quot;&lt;/kbd&gt;)); 
     LOG((&lt;kbd&gt;&quot;length %d&quot;&lt;/kbd&gt; , 1239));
}
&lt;cite&gt;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/cite&gt;
}&lt;/code&gt;&lt;/pre&gt;&amp;nbsp; &lt;br /&gt;
&lt;blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;4. Random number without Using rand() function.&lt;br /&gt;
Today i faced a problem during use of rand() function. As the SDK, i am working on doesn&#39;t support rand() function.&lt;br /&gt;
For the solution of this i use one method. I read system time in yyyymmddhhmmss format then add all digits and take the mode of desire range.&lt;br /&gt;
In this way i get the desire random number in a range.&lt;br /&gt;
&lt;br /&gt;
5. Some day before i was just stuck with a problem of accessing linux m/c via window m/c.&lt;br /&gt;
My requirement was to copy some data from my win m/c to linux box then execute that data on linux m/c with a very small setup and in a single click.&lt;br /&gt;
I just Google on net and found that two thing i can use:-&lt;br /&gt;
Putty for commands.&lt;br /&gt;
PSCP for data transfer.&lt;br /&gt;
&lt;br /&gt;
Then big question :- I need to do it in single click!!!&lt;br /&gt;
then i found that there are lots of putty and PSCP commands available that i can use in batch file which will execute by a single click. And all will be execute in background.&lt;br /&gt;
And size of all setups is less then 1 MB... :)&lt;br /&gt;
The commands are:-&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;!-- BEGIN geoiptool.com --&gt;&lt;br /&gt;
&lt;script language=&quot;JavaScript&quot;
src=&quot;http://www.geoiptool.com/webjs.php?xl=en&amp;xt=1&amp;xw=200&amp;xh=275&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;noscript&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://www.geoiptool.com/&quot;&gt;Geo Web Tool&lt;/a&gt;&lt;/noscript&gt;&lt;br /&gt;
&lt;!-- END geoiptool.com --&gt;   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.tinycounter.com/&quot; target=&quot;_blank&quot; title=&quot;hit counter&quot;&gt;&lt;img alt=&quot;hit counter&quot; border=&quot;0&quot; src=&quot;http://mycounter.tinycounter.com/index.php?user=anandrai&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://codingproblem.blogspot.com/feeds/3100703285213541238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://codingproblem.blogspot.com/2009/10/coding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3100703285213541238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3016365607685677561/posts/default/3100703285213541238'/><link rel='alternate' type='text/html' href='http://codingproblem.blogspot.com/2009/10/coding.html' title='Coding'/><author><name>Anand Rai</name><uri>http://www.blogger.com/profile/07018826215519469577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>