<?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-4467996862831967117</id><updated>2026-05-23T01:12:09.149-07:00</updated><category term="C"/><category term="C++"/><category term="C Programs"/><category term="Linux"/><category term="CPP"/><category term="Linux Tutorial"/><category term="Linux Kernel"/><category term="C Objective"/><category term="RTOS"/><category term="Tips"/><category term="Android"/><category term="Android Multimedia"/><category term="C Interview Questions"/><category term="C++ Questions"/><category term="C++ Tutorial"/><category term="CPP Interview Questions"/><category term="Audio"/><category term="CPP Quiz"/><category term="Constructor"/><category term="Exception"/><category term="Git"/><category term="Loops"/><category term="OS"/><category term="Pointers"/><category term="Strings"/><category term="Structures"/><category term="extern"/><category term="static"/><category term="Android Interview Questions"/><category term="C Quiz"/><category term="Copy Constructor"/><category term="Data Structures"/><category term="Deep Copy"/><category term="Device Drivers"/><category term="Example Programs"/><category term="Interview Questions"/><category term="KMDF"/><category term="Linux IPC"/><category term="Linux Interview Questions"/><category term="Multimedia"/><category term="Mutable"/><category term="Recursion"/><category term="Shallow Copy"/><category term="Storage Class"/><category term="Virtual Function"/><category term="Windows drivers Interview Questions"/><category term="Android Architecture"/><category term="Android Basics"/><category term="Android Multimedia Tutorial"/><category term="Android SMS Application"/><category term="Armstrong number"/><category term="Arrays"/><category term="Assignment Operator"/><category term="Big Endian"/><category term="Bitwise Operators"/><category term="C Program to Check Leap Year"/><category term="C Questions"/><category term="C Tutorials"/><category term="C++ Features"/><category term="C++ Tips"/><category term="CCPP Programs"/><category term="CCPP Quiz"/><category term="CPP Singleton"/><category term="CPP Tutorial"/><category term="Call By Value and Call By Reference"/><category term="Callback"/><category term="Codecs"/><category term="Command Line Arguments"/><category term="Compiler"/><category term="Const data"/><category term="Conversion Constructor"/><category term="Conversion Operator"/><category term="Dangling Pointer"/><category term="Design Pattern"/><category term="Destructor"/><category term="Dynamic Memory Allocation"/><category term="Enum Variable"/><category term="Exception Handling"/><category term="Explicit Constructor"/><category term="Fibonacci"/><category term="Files"/><category term="For Loop"/><category term="Friend Class"/><category term="Friend Functions"/><category term="Function Overloading"/><category term="Function Pointers"/><category term="GCC"/><category term="GCD of Two Numbers"/><category term="Git Setup"/><category term="IPC"/><category term="Inheritance"/><category term="Inline Functions"/><category term="Interrupts"/><category term="Java"/><category term="Java Interview Questions"/><category term="Keywords"/><category term="Largest 3 Numbers"/><category term="Linux Tutorials"/><category term="MFT"/><category term="Memory Allocation"/><category term="Memory Leak"/><category term="Message Queue"/><category term="Multidimensional Arrays"/><category term="Mutex"/><category term="Named Pipes(FIFO)"/><category term="Namespace"/><category term="OpenMax"/><category term="Operator Overloading"/><category term="Padding"/><category term="Pass by Reference"/><category term="Pipes"/><category term="Polymorphisam"/><category term="Process"/><category term="Pure Virtual Functions"/><category term="Python interview questions"/><category term="RTCP"/><category term="RTOS Interview Questions"/><category term="RTSP"/><category term="RTTI"/><category term="RTp"/><category term="References"/><category term="Reverse Array"/><category term="SMS"/><category term="Scheduling"/><category term="Scope Resolution"/><category term="Semaphore"/><category term="Shared Memory"/><category term="Singleton Class"/><category term="Sorting"/><category term="Stage Fright"/><category term="Stagefright"/><category term="Standard Template Library (STL)"/><category term="Static Functions"/><category term="Storage Qualifiers"/><category term="Synchronization"/><category term="Templates"/><category term="Threads"/><category term="Useful Linux Commands"/><category term="Vi editor"/><category term="Video"/><category term="Virtual Destructor"/><category term="Virtual File System"/><category term="Void Pointer"/><category term="Volatile"/><category term="Vptr"/><category term="Vtable"/><category term="WDF"/><category term="Windows 8"/><category term="Windows Driver"/><category term="Windows Drivers"/><category term="Windows Media Foundation"/><category term="Windows Multimedia"/><category term="auto"/><category term="calloc"/><category term="const"/><category term="const functions"/><category term="fork"/><category term="free"/><category term="main()"/><category term="malloc"/><category term="realloc"/><title type='text'>Programming Tutorial</title><subtitle type='html'>C Programming,C Objective,Advanced C/C++ Programming,C++ Programming,Linux System Programming,RTOS,Interview Questions,Multimedia,Stagefright,Android Application Programming</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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>213</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4467996862831967117.post-6339387677344430081</id><published>2020-12-07T21:03:00.004-08:00</published><updated>2020-12-07T21:03:42.359-08:00</updated><title type='text'>JSON to POJO class creation in Android studio - Kotlin/Java</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;470&quot; src=&quot;https://www.youtube.com/embed/oIUFlu6F-V8&quot; width=&quot;566&quot; youtube-src-id=&quot;oIUFlu6F-V8&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/6339387677344430081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2020/12/json-to-pojo-class-creation-in-android.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/6339387677344430081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/6339387677344430081'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2020/12/json-to-pojo-class-creation-in-android.html' title='JSON to POJO class creation in Android studio - Kotlin/Java'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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/oIUFlu6F-V8/default.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4467996862831967117.post-283605210356812566</id><published>2018-12-24T12:17:00.002-08:00</published><updated>2018-12-24T14:49:59.997-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Useful Linux Commands"/><title type='text'>Useful Linux Commands</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-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;1.&lt;b&gt; &lt;span style=&quot;color: #e69138;&quot;&gt;find&lt;/span&gt;&lt;/b&gt; command used to searches files or directories in entire file system or in current directory&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -name *.java&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #999999;&quot;&gt;//s&lt;i&gt;earches all files with extension .java in current directory&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find / -name Sample -type f&amp;nbsp;&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// &quot;-type f&quot; option used to return only files&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find / -name Sample -type d&lt;/span&gt;   &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// &quot;-type d&quot; option used to return only directories&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find /usr -name &quot;Sample*&quot; -type f&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// searches through the /usr directory for all files that begin with the letters Sample, followed by anything else&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -type d -name build&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// to find all directories named build under the current directory&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -type f -name &quot;Foo*&quot; -exec rm {} \;&lt;/span&gt;  &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// find all files in the current directory that begin with the letters &#39;Foo&#39; and delete them&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -iname foo&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//  Search for all files and directories named foo, FOO, or any other combination of uppercase and lowercase characters in the current directory&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -mtime -7&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// To find all files and directories that have been modified in the last seven days&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -mtime -7 -type f &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// To find all files that have been modified in the last seven days&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find . -mtime -7 -type d&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// To find all directories that have been modified in the last seven days&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;find /opt /usr /var -name sample.sh -type f &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// Searches &quot;samples.sh&quot; file in multiple directories&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;locate&lt;/b&gt;&lt;/span&gt; command is used for search files and directories&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   locate tomcat.sh&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// search the entire file system for &#39;tomcat.sh&#39; (uses the locate database)&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;locate -i spring.jar &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// case-insensitive search&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;grep&lt;/b&gt;&lt;/span&gt; command is used for search strings&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   grep &#39;joe&#39; *&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt; &lt;i&gt;// Search for string in multiple files&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -i score sample.txt&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// case-insensitive file searching&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -n we&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;sample&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;.txt&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// To show the line numbers of the files that match your grep command, just add the -n option&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -inR &quot;text&quot; .&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;//&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;i style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;case-insensitive file searching in current directory&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep &#39;fred&#39; /etc/passwd&lt;/span&gt;  &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// search for lines containing &#39;fred&#39; in /etc/passwd&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep fred /etc/passwd&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// quotes usually not when you don&#39;t use regex patterns&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -B5 &quot;the living&quot; sample.txt&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//show all matches, and five lines before each match&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -A10 &quot;the living&quot; sample.txt&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #999999;&quot;&gt; &lt;i&gt;// show all matches, and ten lines after each match&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -B5 -A5 &quot;the living&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;sample&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;.txt&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt; &lt;i&gt;//five lines before and ten lines after&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep -n we&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;sample&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;.txt&lt;/span&gt;&amp;nbsp; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// show line numbers as well as the matching lines&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep &#39;^fred&#39; /etc/passwd&lt;/span&gt;&amp;nbsp; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//find &#39;fred&#39;, but only at the start of a line&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep &#39;[FG]oo&#39; *&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// find Foo or Goo in all files in the current dir&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;grep &#39;[0-9][0-9][0-9]&#39; *&lt;/span&gt;&amp;nbsp; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// find all lines in all files in the current dir with three numbers in a row&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;egrep &#39;apple|banana|orange&#39; *&lt;/span&gt;&amp;nbsp; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// search for multiple patterns, all files in current dir&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;egrep -i &#39;apple|banana|orange&#39; *&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// same thing, case-insensitive&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;egrep &#39;score|nation|liberty|equal&#39; sample.txt&amp;nbsp;&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// all lines matching multiple patterns&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;egrep &#39;score|nation|liberty|equal&#39; gettysburg-address.txt &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// This Unix egrep command searches the file named gettysburg-address.txt for the four strings shown (score, nation, liberty, and equal). It returns any lines from the file that contain any of those words.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;cat&lt;/b&gt;&lt;/span&gt; command is used to view text files&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   cat -n myfile.txt&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// Showing line numbers&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;cat /etc/passwd&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// to view the contents of the /etc/passwd file on your Unix/Linux system&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;cat sample.txt&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// display the content of the file   &lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;5. &lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;wc&lt;/b&gt;&lt;/span&gt; command is used for count&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   $ wc /etc/passwd&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt;  // to count the number of lines, words, and characters in a file&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65     185    3667 /etc/passwd&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;$ wc -l /etc/passwd&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// If you just want to know the number of lines in a file just add the -l argument&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;65 /etc/passwd&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;$ wc -w MyStory.txt&lt;/span&gt;  &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// if you want to know the number of words in a file, add the -w argument, like this&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 185 MyStory.txt&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;ps -e | wc -l&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// shows the number of processes currently running on your Linux system&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;6. &lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;rm&lt;/b&gt;&lt;/span&gt; command is used for removing files or directories&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   rm oldfile.txt &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// to remove one file&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;rm file1 file2 file3&lt;/span&gt;&amp;nbsp; &lt;span style=&quot;color: #999999;&quot;&gt;//&amp;nbsp;&lt;i&gt;to delete multiple Linux files at one tim&lt;/i&gt;e&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;rm -i files file2 file3&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// The -i stands for &quot;inquire&quot;, so when you use this option the rm command prompts you with a yes/no prompt before actually deleting&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;rm -r OldDirectory&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// To delete Linux directories with the rm command, you have to specify the -r option&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;rm -r Directory1 Directory2 Directory3&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// delete multiple directories at one time&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;rm *.html&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// to delete all HTML files in the current directory&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;rm index*&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// where I&#39;m deleting all files in the current directory that begin with the string &quot;index&quot;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;7. &lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;mv&lt;/b&gt;&lt;/span&gt; command to rename or move Linux files and directories&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   mv Chapter1 Chapter1.old&lt;br /&gt;mv MyStuff /tmp&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// if you have a directory named MyStuff, you can move it to the /tmp directory&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;mv file1 file2 file3 /tmp&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// where three files are moved to the /tmp directory&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;mv file1 ..&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// if you want to move it up one level in the directory hierarchy&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;8. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;pwd&lt;/span&gt;&lt;/b&gt; to get current directory path&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;$ pwd&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; /home/techchai/ &lt;br /&gt;&lt;br /&gt;9. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;mkdir&lt;/span&gt;&lt;/b&gt; command is used for creating directories&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   mkdir tmp&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// creates a new directory named tmp in your current directory&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;mkdir memos letters e-mail&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// create multiple directories at one time&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;mkdir -p /home/joe/customer/acme/foo/bar&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// to create several sub directories at one time&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;10. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;ls&lt;/span&gt;&lt;/b&gt; command is used to list files and directories&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;ls -al&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// show all the files in cyrrent directory&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;11. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;tar&lt;/span&gt;&lt;/b&gt; command is used to create tar files&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;    tar cvf MyProject.20090816.tar MyProject&lt;/span&gt;&lt;i&gt;  &lt;span style=&quot;color: #999999;&quot;&gt;// tar command is to create an archive of a subdirectory. &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;i&gt;c means “create archive.”&lt;br /&gt;v means “verbose,” which tells tar to print all the filenames as they are added to the archive.&lt;br /&gt;f tells tar that the name of the archive appears next (right after these options).&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   tar tvf my-archive.tar&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;&lt;i&gt;// List the contents of a tar archive&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;tar tzvf my-archive.tgz&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//To list all the files in a compressed archive, add the z flag&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;tar xvf my-archive.tar&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//  Extracting a tar archive&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;tar xzvf my-archive.tar.gz&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// For compressed archives the tar extract command&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;tar czvf MyProject.20090816.tgz MyProject&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// You can compress a tar archive with the gzip command after you create it&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;12. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;top&lt;/span&gt;&lt;/b&gt; command is an interactive utility that displays a character-based screen of all processes running on the current system&lt;br /&gt;&lt;br /&gt;    13. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;who&lt;/span&gt;&lt;/b&gt; command lets you display the users that are currently logged into your Unix computer system&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt;$ who&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;14. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;ps&lt;/span&gt;&lt;/b&gt; command by itself, it only shows very basic information about the processes you are currently running&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp;$ps&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;15. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;df&lt;/span&gt;&lt;/b&gt; command stands for &quot;disk free&quot;. It is meant to show Linux disk space information, including disk space that is used, disk space remaining, and how filesystems are mounted on your Linux (or Unix) system&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$ df&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Filesystem  1K-blocks   Used     Available  Use%  Mounted on&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/dev/vzfs   10485760    5713424  4772336    55%   /&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;16. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;du&lt;/span&gt;&lt;/b&gt; command shows disk usage information about only the files and directories you specify&lt;br /&gt;&lt;br /&gt;17. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;lsof&lt;/span&gt;&lt;/b&gt; command lists information about files that are open by processes running on the system. (The lsof command itself stands for “list of open files.”)&lt;br /&gt;&lt;br /&gt;18. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;chmod&lt;/span&gt;&lt;/b&gt; command name stands for &quot;change mode&quot;, and as that name implies, the chmod command is used to change the mode of Unix/Linux files.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;    chmod +x myShellScript.sh&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//  is commonly used to make a file &quot;executable&quot;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;chmod +r myfile.txt&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;//  use of the chmod command is to make a file &quot;readable&quot;. If a file doesn&#39;t have read permission, you can add read permission to that file&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;chmod +w myfile.txt&lt;/span&gt; &lt;span style=&quot;color: #999999;&quot;&gt;// In the same way, you can also give a file write permission&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;19. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;cp&lt;/span&gt;&lt;/b&gt; command to copy files and directories on Linux systems&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;    cp source destination&lt;/span&gt;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// This cp command copies the original file named source to the new file named destination. After issuing this command both your original file and the new file will be in the current directory.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;    cp -r Foo /tmp&lt;/span&gt; &lt;i&gt;&lt;span style=&quot;color: #999999;&quot;&gt;// You can also copy directories with the Linux cp command, and when you do this, you just need to remember to use the -r option&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;20. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;uname&lt;/span&gt;&lt;/b&gt; // Stands for Unix name - print detailed information about the machine name, Operating System and Kernel.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;   root@techchai:~# uname -a&lt;br /&gt;Linux techchai 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:36:13 UTC 2013 i686 i686 i686 GNU/Linux&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;21. &lt;b&gt;&lt;span style=&quot;color: orange;&quot;&gt;history&lt;/span&gt;&lt;/b&gt;&amp;nbsp;command is used to prints the history of long list of executed commands in terminal.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/283605210356812566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2018/12/useful-linux-commands.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/283605210356812566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/283605210356812566'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2018/12/useful-linux-commands.html' title='Useful Linux Commands'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-3866534774919386753</id><published>2018-12-22T19:14:00.002-08:00</published><updated>2018-12-22T19:15:16.086-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Interview Questions"/><title type='text'>Android Interview Questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://coderinsight.blogspot.com/2018/12/android-interview-questions.html&quot;&gt;https://coderinsight.blogspot.com/2018/12/android-interview-questions.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/3866534774919386753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2018/12/android-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/3866534774919386753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/3866534774919386753'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2018/12/android-interview-questions.html' title='Android Interview Questions'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-2730713697760997006</id><published>2018-12-22T19:07:00.003-08:00</published><updated>2018-12-22T19:07:49.568-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Interview Questions"/><title type='text'>Java Interview Questions</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-family: Verdana, sans-serif;&quot;&gt;1) Explain OOP Concepts&lt;br /&gt;2) Differences between abstract classes and interfaces?&lt;br /&gt;3) What is the difference between iterator and enumeration in java?&lt;br /&gt;4) Composition vs Inheritance&lt;br /&gt;5) Difference between method overloading and overriding&lt;br /&gt;6) What are the access modifiers you know? What does each one do? &lt;br /&gt;7) Can an Interface implement another Interface?&lt;br /&gt;8) What is Polymorphism? What is Inheritance?&lt;br /&gt;9) Explain Generics in Java?&lt;br /&gt;10) Stack vs Queue&lt;br /&gt;11) HashMap vs Set&lt;br /&gt;12) HashSet vs TreeSet&lt;br /&gt;13) What is Java PriorityQueue?&lt;br /&gt;14) How is String class implemented? Why was it made immutable?&lt;br /&gt;15) What does it means to say that a String is immutable?&lt;br /&gt;16) What is String.intern()? When and why should it be used?&lt;br /&gt;17) Can you list primitive types in Java?&lt;br /&gt;18) What is the difference between an Integer and int?&lt;br /&gt;19) What is Autoboxing and Unboxing?&lt;br /&gt;20) Typecast in Java?&lt;br /&gt;21) Do objects get passed by reference or value in Java? Elaborate on that.&lt;br /&gt;22) What is the difference between instantiation and initialization of an object?&lt;br /&gt;23) What the difference between local, instance and class variables?&lt;br /&gt;24) What is garbage collector? How does it work?&lt;br /&gt;25) What is memory leak and how does Java handle it?&lt;br /&gt;26) What are strong, soft, weak and phantom references in Java?&lt;br /&gt;27) What does the keyword synchronized mean?&lt;br /&gt;28) What is a ThreadPoolExecutor?&lt;br /&gt;29) What is volatile modifier? &lt;br /&gt;30) How does the try{} catch{} finally{} works?&lt;br /&gt;31) What is the difference between a Checked Exception and an Un-Checked Exception?&lt;br /&gt;32) What is serialization? How do you implement it?&lt;br /&gt;33) What is transient modifier?&lt;br /&gt;34) What are anonymous classes?&lt;br /&gt;35) What is the difference between using == and .equals on an object?&lt;br /&gt;36) What is the hashCode() and equals() used for?&lt;br /&gt;37) Why would you not call abstract method in constructor?&lt;br /&gt;38) When would you make an object value final?&lt;br /&gt;39) What are these final, finally and finalize keywords?&lt;br /&gt;40) What does the static word mean in Java?&lt;br /&gt;41) Can a static method be overridden in Java?&lt;br /&gt;42) When is a static block run?&lt;br /&gt;43) What is reflection?&lt;br /&gt;44) How is a StringBuilder implemented to avoid the immutable string allocation problem?&lt;br /&gt;45) Difference between StringBuffer and StringBuilder? &lt;br /&gt;46) What’s the difference between an Enumeration and an Iterator?&lt;br /&gt;47) What is the difference between fail-fast and fail-safe iterators in Java?&lt;br /&gt;48) What do you mean by platform independence of Java?&lt;br /&gt;49) What is the difference between JDK and JVM?&lt;br /&gt;50) Which class is the superclass of all classes?&lt;br /&gt;51) Why Java doesn’t support multiple inheritance?&lt;br /&gt;52) Why Java is not pure Object Oriented language?&lt;br /&gt;53) What is the importance of main method in Java?&lt;br /&gt;54) Can we overload main method?&lt;br /&gt;55) Can we have multiple public classes in a java source file?&lt;br /&gt;56) What is Java Package and which package is imported by default?&lt;br /&gt;57) What are access modifiers?&lt;br /&gt;58) What is final keyword?&lt;br /&gt;59) What is static keyword?&lt;br /&gt;60) Can we declare a class as static?&lt;br /&gt;61) What are Wrapper classes?&lt;br /&gt;62) What is Enum in Java?&lt;br /&gt;63) What is composition in java?&lt;br /&gt;64) What does super keyword do?&lt;br /&gt;65) What is this keyword?&lt;br /&gt;66) What is break and continue statement?&lt;br /&gt;67) What is default constructor?&lt;br /&gt;68) Can we have try without catch block?&lt;br /&gt;69) What is the use of System class?&lt;br /&gt;70) What is instanceof keyword?&lt;br /&gt;71) What is difference between Heap and Stack Memory?&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/2730713697760997006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2018/12/java-interview-questions.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2730713697760997006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2730713697760997006'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2018/12/java-interview-questions.html' title='Java Interview Questions'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4467996862831967117.post-7591618681391868287</id><published>2017-05-21T16:20:00.002-07:00</published><updated>2017-05-21T16:20:39.306-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Interview Questions"/><category scheme="http://www.blogger.com/atom/ns#" term="Python interview questions"/><title type='text'>Python Interview Questions</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-family: Verdana, sans-serif;&quot;&gt;1) What is Python? What are the benefits of using Python and its main features?&lt;br /&gt;2) What is PEP 8?&lt;br /&gt;3)&amp;nbsp;What Are The Built-In Types Available In Python?&lt;br /&gt;4)&amp;nbsp;What is mutable and immutable objects in python?&lt;br /&gt;5)&amp;nbsp;Difference between remove, pop, del on lists?&lt;br /&gt;6)&amp;nbsp;What is the difference between list and tuple?&lt;br /&gt;7)&amp;nbsp;What are tuples?&lt;br /&gt;8) What is difference between tuple and list ? Where will you use tuple and &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where will you use list ?&lt;br /&gt;9)&amp;nbsp;What is Dynamic Typing ?&lt;br /&gt;10)&amp;nbsp;What are *args, **kwargs ?&lt;br /&gt;11)&amp;nbsp;How instance variables are different from class variables?&lt;br /&gt;12)&amp;nbsp;Differentiate between “*.py” file and “*.pyc” file?&lt;br /&gt;13)&amp;nbsp;Explain the use “with” statement in python?&lt;br /&gt;14)&amp;nbsp;What does the “self” keyword do?&lt;br /&gt;15)&amp;nbsp;What Are Different Methods To Copy an Object In Python?&lt;br /&gt;16) What does the &amp;lt;yield&amp;gt; keyword do in Python?&lt;br /&gt;17) What is pickling and unpickling?&lt;br /&gt;18)&amp;nbsp;How are arguments passed by value or by reference?&lt;br /&gt;19)&amp;nbsp;What is namespace in Python?&lt;br /&gt;20)&amp;nbsp;How you can convert a number to a string?&lt;br /&gt;21)&amp;nbsp;What is module and package in Python?&lt;br /&gt;22)&amp;nbsp;What is a pass in Python?&lt;br /&gt;23)&amp;nbsp;Write a function to merge the two lists into one sorted list:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X = [2, 5, 7, 10, 11, 18]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Y = [1, 4, 6, 12, 14, 17, 21]&lt;br /&gt;24)&amp;nbsp;How can we get home directory using &#39;~&#39; in Python?&lt;br /&gt;25)&amp;nbsp;Difference between range and xrange?&lt;br /&gt;26)&amp;nbsp;Generators in Python and its use?&lt;br /&gt;27) What are Iterators ?&lt;br /&gt;28)&amp;nbsp;How to debug python code using PDB?&lt;br /&gt;29)&amp;nbsp;What Lambda and use in Python?&lt;br /&gt;30)&amp;nbsp;How does Python handle the memory management?&lt;br /&gt;31)&amp;nbsp;What is monkey patching? How can you do it in Python?&lt;br /&gt;32)&amp;nbsp;Why are functions considered first class objects in Python?&lt;br /&gt;33)&amp;nbsp;How will you reverse the list in Python?&lt;br /&gt;34) Explain how can you generate random numbers in Python?&lt;br /&gt;35) Explain the usage of decorators?&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/7591618681391868287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2017/05/python-interview-questions.html#comment-form' title='78 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/7591618681391868287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/7591618681391868287'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2017/05/python-interview-questions.html' title='Python Interview Questions'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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>78</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4467996862831967117.post-6925325528036058793</id><published>2016-12-20T19:20:00.000-08:00</published><updated>2016-12-20T19:22:53.951-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Data Structures"/><title type='text'>What is Data structure?</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-family: Verdana, sans-serif;&quot;&gt;Data structure is a method of organizing large amount of data more efficiently so that any operation on that data becomes easy.&lt;br /&gt;&lt;br /&gt;Data structures are divided into two types:&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Linear Data Structures&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Non linear Data structures&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Linear Data Structure:&lt;/b&gt; In Linear data structure, data is organised in sequential order.&lt;br /&gt;Ex: Arrays, Linked list, Stacks and Queues&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Non Linear Data Structure:&lt;/b&gt; In Non Linear data structure, data is organised in random order.&lt;br /&gt;Ex: Tree, Graphs&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/6925325528036058793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2016/12/what-is-data-structure.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/6925325528036058793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/6925325528036058793'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2016/12/what-is-data-structure.html' title='What is Data structure?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4467996862831967117.post-2778422745652977007</id><published>2016-04-17T18:52:00.003-07:00</published><updated>2016-12-14T20:50:55.241-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Interrupt Handling in Linux</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-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;What is Interrupt?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;An interrupt (also known as an exception or trap) is an event that causes the CPU to stop executing the current program and start executing a special piece of code called an interrupt handler or interrupt service routine (ISR).&lt;br /&gt;&lt;br /&gt;There are two different kinds of interrupts:&lt;br /&gt;&lt;br /&gt;         •Synchronous interrupt (Exception) produced by the CPU while processing instructions&lt;br /&gt;         •Asynchronous interrupt (Interrupt) issued by other hardware devices&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Handling interrupts:&lt;/b&gt;&lt;br /&gt;   •Interrupts can occur at any time, the kernel tries to get it out of the way as soon as possible&lt;br /&gt;•An interrupt can be interrupted by another interrupt&lt;br /&gt;   •There are regions in the kernel which must not be interrupted at all&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Two different interrupt levels are defined:&lt;/b&gt;&lt;br /&gt;   •Maskable interrupts issued by I/O devices; can be in two states, masked or unmasked. Only unmasked interrupts are getting processed.&lt;br /&gt;•Nonmaskable interrupts; critical malfunctions (f.e. hardware failure); always processed by the CPU.&lt;br /&gt;&lt;br /&gt;Every hardware device has it&#39;s own Interrupt Request (IRQ) line. The IRQs are numbered starting from 0. All IRQ lines are connected to a Programmable Interrupt Controller (PIC). The PIC listens on IRQs and assigns them to the CPU. It is also possible to disable a specific IRQ line.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Top Half and Bottom Half:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One of the main problems with interrupt handling is how to perform lengthy tasks within a handler. Often a substantial amount of workmust be done in response to a device interrupt, but interrupt handlers need to finish up quickly and not keep interrupts blocked for long. These two needs (work and speed) conflict with each other,leaving the driver writer in a bit of a bind.&lt;br /&gt;&lt;br /&gt;Linux (along with many other systems) resolves this problem by splitting the interrupt handler into two halves. The so-called top half is the routine that actually responds to the interrupt—the one you register with request_irq. The bottom half is a routine that is scheduled by the top half to be executed later, at a safer time. The big difference between the top-half handler and the bottom half is that all interrupts are enabled during execution of the bottom half—that’s why it runs at a safer time.&lt;br /&gt;&lt;br /&gt;To implement bottom halves,two methods:&lt;br /&gt;1) task lets&lt;br /&gt;2) work queues&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/2778422745652977007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2016/04/interrupt-handling-in-linux.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2778422745652977007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2778422745652977007'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2016/04/interrupt-handling-in-linux.html' title='Interrupt Handling in Linux'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4467996862831967117.post-4919925356094952592</id><published>2016-04-17T18:50:00.001-07:00</published><updated>2016-12-14T20:52:16.039-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Kernel"/><title type='text'>Linux Kernel Modules</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-family: Verdana, sans-serif;&quot;&gt;Linux kernel modules are pieces of code that can be loaded and unloaded from kernel on demand.&lt;br /&gt;&lt;br /&gt;Kernel modules offers an easy way to extend the functionality of the base kernel without having to rebuild or recompile the kernel again. Most of the drivers are implemented as a Linux kernel modules. When those drivers are not needed, we can unload only that specific driver, which will reduce the kernel image size.&lt;br /&gt;&lt;br /&gt;Kernel modules will have extension .ko&lt;br /&gt;Kernel modules will operate on kernel space.&lt;br /&gt;All Drivers are modules. Not all modules are drivers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Kernel Modules Commands:&lt;/b&gt;&lt;br /&gt;lsmod: To see list of modules that already loaded on system&lt;br /&gt;insmod: To insert modules into kernel&lt;br /&gt;modinfo: To display modules information&lt;br /&gt;rmmod: To remove modules from kernel&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;How to Write Kernel Modules:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
module.c&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px solid rgb(221, 221, 221); clear: both; color: #111111; font-family: Consolas, Monaco, Menlo, Courier, Verdana, sans-serif; font-size: 13px; line-height: 26px; margin-bottom: 26px; overflow: auto; padding: 13px; tab-size: 4; word-wrap: normal;&quot;&gt;#include &amp;lt;linux/module.h&amp;gt;    // included for all kernel modules
#include &amp;lt;linux/kernel.h&amp;gt;    // included for KERN_INFO
#include &amp;lt;linux/init.h&amp;gt;      // included for __init and __exit macros

MODULE_LICENSE(&quot;GPL&quot;);
MODULE_AUTHOR(&quot;Name&quot;);
MODULE_DESCRIPTION(&quot;Hello World module&quot;);

static int __init hello_init(void)
{
    printk(KERN_INFO &quot;Hello world!\n&quot;);
    return 0;    // Non-zero return means that the module couldn&#39;t be loaded.
}

static void __exit hello_cleanup(void)
{
    printk(KERN_INFO &quot;Cleaning up module.\n&quot;);
}

module_init(hello_init);
module_exit(hello_cleanup);&lt;/pre&gt;
&lt;span style=&quot;font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;b&gt;Makefile to compile module:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px solid rgb(221, 221, 221); clear: both; color: #111111; font-family: Consolas, Monaco, Menlo, Courier, Verdana, sans-serif; font-size: 13px; line-height: 26px; margin-bottom: 26px; overflow: auto; padding: 13px; tab-size: 4; word-wrap: normal;&quot;&gt;obj-m += hello.o

all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;When a module is inserted into the kernel, the module_init macro will be invoked, which will call the function hello_init. Similarly, when the module is removed with rmmod, module_exit macro will be invoked, which will call the hello_exit. Using dmesg command, we can see the output from the sample Kernel module.&lt;br /&gt;&lt;br /&gt;printk() is used for printing kernel messages&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/4919925356094952592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2016/04/linux-kernel-modules.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/4919925356094952592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/4919925356094952592'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2016/04/linux-kernel-modules.html' title='Linux Kernel Modules'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-3657218305497358956</id><published>2016-04-17T18:26:00.002-07:00</published><updated>2016-04-17T18:26:19.382-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Kernel"/><title type='text'>Latest Kernel version</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-family: Verdana, sans-serif;&quot;&gt;Current stable kernel version: &lt;b&gt;4.5.1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;https://www.kernel.org/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/3657218305497358956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2016/04/latest-kernel-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/3657218305497358956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/3657218305497358956'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2016/04/latest-kernel-version.html' title='Latest Kernel version'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-1770144424745562588</id><published>2014-09-05T20:30:00.000-07:00</published><updated>2017-05-13T15:14:01.942-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><category scheme="http://www.blogger.com/atom/ns#" term="Reverse Array"/><title type='text'>C program to reverse an array</title><content type='html'>
&lt;pre name=&quot;code&quot; class=&quot;cpp&quot;&gt;
#include  
int main() 
{ 
      int n, c, d, a[100], b[100]; 
      printf(&quot;Enter the number of elements in array\n&quot;); 
      scanf(&quot;%d&quot;, &amp;n); 
      printf(&quot;Enter the array elements\n&quot;); 
      for (c = 0; c &lt; n ; c++) 
           scanf(&quot;%d&quot;, &amp;a[c]); 
      for (c = n - 1, d = 0; c &gt;= 0; c--, d++) 
           b[d] = a[c]; 
      for (c = 0; c &lt; n; c++) 

           a[c] = b[c]; 

      printf(&quot;Reverse array is\n&quot;); 

      for (c = 0; c &lt; n; c++) 

      printf(&quot;%d\n&quot;, a[c]);
 
 return 0; 

}

This program reverses the array elements. For example if a is an array of integers with three elements such that
a[0] = 1
a[1] = 2
a[2] = 3

Then on reversing the array will be
a[0] = 3
a[1] = 2
a[0] = 1
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/1770144424745562588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2014/09/c-program-to-reverse-array.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1770144424745562588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1770144424745562588'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2014/09/c-program-to-reverse-array.html' title='C program to reverse an array'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-112414071390621347</id><published>2014-08-15T09:39:00.002-07:00</published><updated>2014-08-15T09:45:51.323-07:00</updated><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="CPP Singleton"/><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>C++; Singleton Design Pattern</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Singleton is a creational design pattern. &lt;br /&gt;Provide one and only instance of an object.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;#include 

using namespace std;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;class MySingleton&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public:
 static MySingleton* iInstance;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public:
 static MySingleton* GetInstance();&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; private: MySingleton();&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;};&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;MySingleton* MySingleton::iInstance = NULL;&amp;nbsp;
&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;MySingleton::MySingleton()&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;Inside construtor ...&quot; &amp;lt;&amp;lt; endl;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;MySingleton* MySingleton::GetInstance()&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if ( iInstance == NULL )&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iInstance = new MySingleton();&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return iInstance;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;void main()&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MySingleton* obj;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;obj = MySingleton::GetInstance();&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/112414071390621347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2014/08/c-singleton-design-pattern.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/112414071390621347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/112414071390621347'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2014/08/c-singleton-design-pattern.html' title='C++; Singleton Design Pattern'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-1989874305492427523</id><published>2014-08-02T12:50:00.000-07:00</published><updated>2014-09-05T20:33:27.638-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Vi editor"/><title type='text'>Useful linux commands</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-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Vi Editor:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Delete character at cursor&lt;br /&gt;&amp;nbsp; &amp;nbsp; X &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Delete character before cursor&lt;br /&gt;&amp;nbsp; &amp;nbsp; Y&amp;nbsp;or&amp;nbsp;yy &amp;nbsp;Yank (copy) current line into &quot;unnamed&quot; storage buffer.&lt;br /&gt;&amp;nbsp; &amp;nbsp; p &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Paste unnamed storage buffer after current line.&lt;br /&gt;&amp;nbsp; &amp;nbsp; P &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Paste unnamed storage buffer before current line.&lt;br /&gt;&amp;nbsp; &amp;nbsp; r &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Replace character&lt;br /&gt;&amp;nbsp; &amp;nbsp; R &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Overwrite characters from cursor onward&lt;br /&gt;&amp;nbsp; &amp;nbsp; s &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Substitute one character under cursor continue to insert&lt;br /&gt;&amp;nbsp; &amp;nbsp; S &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Substitute entire line and begin to insert at beginning of line&lt;br /&gt;&amp;nbsp; &amp;nbsp; J &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Join current and following line into one line&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;Use command: &quot;:e filename&quot;&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Start new edit session on specified file name without closing current vi / &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vim editor process.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;ul style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;Find/Replace:Example:&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:%s/fff/rrrrr/ &amp;nbsp;- &amp;nbsp; For all lines in a file, find string &quot;fff&quot; and replace with &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; string &quot;rrrrr&quot; for the first instance on a line.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:%s/fff/rrrrr/g - &amp;nbsp;For all lines in a file, find string &quot;fff&quot; and replace with &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; string &quot;rrrrr&quot; for each instance on a line.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:%s/fff/rrrrr/gc - For all lines in a file, find string &quot;fff&quot; and replace with &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; string &quot;rrrrr&quot; for each instance on a line. Ask for &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; confirmation&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:%s/fff/rrrrr/gi - For all lines in a file, find string &quot;fff&quot; and replace with &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; string &quot;rrrrr&quot; for each instance on a line. Case &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; insensitive.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Extract or Unpack a tar File:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To extract tar file of type:&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tar -xvf &amp;lt;filename&amp;gt;.tar&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To extract  .tar.gz (gzip) file&lt;/span&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;tar -xzvf &amp;lt;file name&amp;gt;.tar.gz&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To extract .tar.bz2 (bzip2) file&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tar -xjvf file.tar.bz2&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To extarct single file from tar file&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tar -xvf file.tar foo.txt&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tar -xzvf file.tar.gz foo.txt&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tar -xjvf file.tar.bz2 foo.txt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Where,&lt;br /&gt;-x : Extract a tar ball.&lt;br /&gt;-v : Verbose output or show progress while extracting files.&lt;br /&gt;-f : Specify an archive or a tarball filename.&lt;br /&gt;-j : Decompress and extract the contents of the compressed archive created by bzip2 program (tar.bz2 extension).&lt;br /&gt;-z : Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/1989874305492427523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2014/08/useful-linux-commands.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1989874305492427523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1989874305492427523'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2014/08/useful-linux-commands.html' title='Useful linux commands'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-5675373454451541036</id><published>2013-05-05T04:21:00.001-07:00</published><updated>2013-05-05T04:22:34.186-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++ Tips"/><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><title type='text'>C++ Tips</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Class&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; is collection of data members and member fn.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Object&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; is a instance of a class&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Abstraction&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; is hiding unessential
things and reveal the essential things.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Encapsulation&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; is wrapping up data and
functions into a single unit &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Abstraction
implies encapsulation.(Relationship between Abstraction and Encapsulation)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Inheritance&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; is a process of crating new
class form existing class.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;The new class
is called &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Derived class&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; and the old
class is called &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Base class &lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Inheritance
is mainly used to code reusability.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%; text-indent: 0.5in;&quot;&gt;In multiple
inheritance &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%; text-indent: 0.5in;&quot;&gt;occur an ambiguity error&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%; text-indent: 0.5in;&quot;&gt;.
But multilevel inheritance not occur an ambiguity error.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt;Composite&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; line-height: 150%;&quot;&gt; is a opposite of Inheritance.
It’s used to related between two distinct classes (unrelated classes).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Function overloading &lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;function having same name with different
signature in same class.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Operator overloading&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; means to
work on a different operand.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Function overriding&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; function
having same name with same signature in different class.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Polymorphism&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is ability to
assure&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;several distinct forms(tasks).
There are two type of polymorphism is available&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: -48px;&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&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;&lt;/span&gt;&lt;/o:p&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; text-indent: -0.5in;&quot;&gt;i.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 7pt; text-indent: -0.5in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;static or compile time&amp;nbsp;Polymorphism&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; text-indent: -0.5in;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Operator
overloading and &amp;nbsp; function overloading)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1.5in; mso-list: l1 level1 lfo1; tab-stops: list 1.5in; text-indent: -.5in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ii.Dynamic or run time&amp;nbsp;Polymorphism&amp;nbsp;( Virtual function)&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;&lt;b&gt;Virtual functions&lt;/b&gt; work in overridden technique. Virtual fn is mainly used to, base class pointer can access derived class functions.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Abstract class means&lt;/b&gt;, a class which
contain at least one pure virtual function. In abstract class cannot create an
object.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Pure virtual function&lt;/b&gt; is a virtual
function with expression equal to zero in declaration part.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Macro&lt;/b&gt; is a single line replacement of
set of statements.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Inline&lt;/b&gt; is a keyword , its appear before
function name. This function is faster than normal function. Inline function is
a single line replacement of set of statements.&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;







&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Both (macro
and inline function) functions are replaced a set of &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; statement. The statements
are replaced in &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Pre-compilation Time&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Before
compilation).&lt;/span&gt;&lt;/div&gt;
&lt;h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-weight: normal;&quot;&gt;Inline functions are used
in Type checking like normal function.&amp;nbsp;
But macro won’t &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;(&lt;/span&gt;Difference&lt;span style=&quot;font-weight: normal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;In
structure , the default access specifies is Public.&amp;nbsp; But class , is Private&lt;/span&gt; &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(Difference)&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;In structure,&amp;nbsp; the data members are associated in separate
memory.&amp;nbsp; But Union, data members are
shared in common memory. The size of union = Largest data member size in union&lt;/span&gt; &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(Difference)&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-weight: normal;&quot;&gt;New is
operator, it’s overloaded, it’s call constructor automatically.&amp;nbsp; But malloc() is not overloaded and it’s
cannot call constructor. But both are allocate memory.&lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(Difference)&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Malloc() and calloc() both are
allocate memory. But malloc() allocate memory and store(initialize) the garbage
value. But calloc() allocate memory, its allocate integer type then initialize
zero its string initialize NULL value.&lt;/span&gt; &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(Difference)&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-weight: normal;&quot;&gt;Delete
statement delete the all elements in an array, but the destructor call only the
first element.delete[] statement delete
the all element in an array, the destructor call each and every element in an
array.&lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;(Difference)&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Delete&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is a operator, it can be
overload. Its call destructor call automatically. Delete operator mainly used
to de-allocate memory.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;New&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is a operator , its overload
operator. Its call constructor automatically. New operator mainly used to
allocate memory.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Constructor&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is call automatically,
whenever an object is created then the constructor is call.&amp;nbsp; Constructor is overload, it cannot return a
value, and return type.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Destructor&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is a call automatically,
whenever an object is destroyed then the destructor will call.Its can’t overloaded, its cannot return a
value and return type.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;this pointer&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; is a constant pointer. Its
can use only non static member function. Its cannot used in static member
function, because the static function share in all object but the this pointer
points the current object.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/h4&gt;
&lt;h3&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: small;&quot;&gt;Explain this:&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .85in; mso-list: l0 level1 lfo2; tab-stops: list .85in; text-indent: -.35in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Ø&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;int (*p)[10]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------
&amp;nbsp;&amp;nbsp;&amp;nbsp; Pointer to array , first preference in
pointer&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .85in; mso-list: l0 level1 lfo2; tab-stops: list .85in; text-indent: -.35in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Ø&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;int&amp;nbsp;
*p[10]&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; Array of pointer to int value , first &amp;nbsp; &amp;nbsp; &amp;nbsp;preference in array&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .85in; mso-list: l0 level1 lfo2; tab-stops: list .85in; text-indent: -.35in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Ø&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;int *f()&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; function pointer&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .85in; mso-list: l0 level1 lfo2; tab-stops: list .85in; text-indent: -.35in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Ø&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;int (*f)()&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; pointer to function&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/5675373454451541036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/c-tips.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/5675373454451541036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/5675373454451541036'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/c-tips.html' title='C++ Tips'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-5193273088952758110</id><published>2013-05-05T04:07:00.001-07:00</published><updated>2013-05-05T04:07:40.236-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Sorting"/><title type='text'>Which is the best sorting method?</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-family: Verdana, sans-serif; font-size: 12pt; text-align: justify;&quot;&gt;There is no sorting method that is universally superior to all
others. The programmer must carefully examine the problem and the desired
results before deciding the particular sorting method. Some of the sorting
methods are given below:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Bubble sort : &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;When a file containing records is to be
sorted then Bubble sort is the best sorting method when sorting by address is
used. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Bsort :&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt; It can be recommended if the input to the
file is known to be nearly sorted.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Meansort :&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt; It can be recommended only for input
known to be very nearly sorted.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Quick Sort :&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt; In the virtual memory environment, where
pages of data are constantly being swapped back and forth between external and
internal storage. In practical situations, quick sort is often the fastest
available because of its low overhead and its average behavior. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Heap sort&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt; : Generally used for sorting of complete
binary tree. Simple insertion sort and straight selection sort : Both are more
efficient than bubble sort. Selection sort is recommended for small files when
records are large and for reverse situation insertion sort is recommended. The
heap sort and quick sort are both more efficient than insertion or selection
for large number of data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Shell sort :&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&amp;nbsp; It
is recommended for moderately sized files of several hundred elements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Radix sort&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; : It is reasonably efficient if the
number of digits in the keys is not too large.&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/5193273088952758110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/which-is-best-sorting-method.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/5193273088952758110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/5193273088952758110'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/which-is-best-sorting-method.html' title='Which is the best sorting method?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-4760808250218111478</id><published>2013-05-05T04:04:00.000-07:00</published><updated>2013-05-05T04:05:01.316-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><category scheme="http://www.blogger.com/atom/ns#" term="Exception"/><title type='text'>Is it possible that one try block can have multiple catch blocks?</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-family: Verdana, sans-serif;&quot;&gt;There can be more than one exception handler (or catch block) for one
try block, because it might so happen that in one single try block there can be
different types of exceptions that can be thrown.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;mybody&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;mybody&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is shown in the
following code snippet: &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;try&lt;br /&gt;
{ &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;// statement that throws
divide-by-zero exception&lt;br /&gt;
// statement that throws array out-of-bound exception &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;br /&gt;
catch ( divide_error id1 ){ // code }&lt;br /&gt;
catch ( out_of_bound_error id2 ){ // code }&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/4760808250218111478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/is-it-possible-that-one-try-block-can.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/4760808250218111478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/4760808250218111478'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/is-it-possible-that-one-try-block-can.html' title='Is it possible that one try block can have multiple catch blocks?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-6072887203122954142</id><published>2013-05-05T04:01:00.000-07:00</published><updated>2013-05-05T04:01:52.837-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Constructor"/><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><category scheme="http://www.blogger.com/atom/ns#" term="Exception"/><title type='text'>Is it possible to throw an exception through a constructor?</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-family: Verdana, sans-serif;&quot;&gt;Yes, we can! We cannot return any error value from the constructor, as
the constructor doesn’t have any return type. In such situation, by throwing an
exception we can pass value to &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;catch&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; block.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;mybody&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;mybody&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is shown in the
following example: &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;iostream.h&amp;gt;&lt;br /&gt;
class sample&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public: &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sample ( int i )&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( i
== 0 ) throw &quot;error&quot;;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;};&lt;br /&gt;
void main( )&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sample s ( 0 ); &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;catch ( char * str )&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; str;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog2in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;} &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/6072887203122954142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/is-it-possible-to-throw-exception.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/6072887203122954142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/6072887203122954142'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/is-it-possible-to-throw-exception.html' title='Is it possible to throw an exception through a constructor?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-8588367601064567961</id><published>2013-05-05T03:27:00.002-07:00</published><updated>2013-05-05T03:28:26.200-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Files"/><title type='text'>How can we copy the contents of one file to another in one shot?</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-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;fstream.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
void main( )&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog1in&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;char source [ 67 ],
target [ 67 ];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;char ch;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; &quot;Enter source filename&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cin &amp;gt;&amp;gt; source;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; &quot;Enter target filename&quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cin &amp;gt;&amp;gt; target;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ifstream infile ( source );&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ofstream outfile ( target );&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;outfile &amp;lt;&amp;lt; infile.rdbuf( ); &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;} &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;mybody&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Here all the copying is done through the single statement&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;outfile &amp;lt;&amp;lt;
infile.rdbuf( ); &lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;myprog&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;mybody&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The function &lt;b&gt;rdbuf( )&lt;/b&gt; returns the address of the &lt;b&gt;strstreambuf&lt;/b&gt;
where the values are stored.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/8588367601064567961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-can-we-copy-contents-of-one-file-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/8588367601064567961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/8588367601064567961'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-can-we-copy-contents-of-one-file-to.html' title='How can we copy the contents of one file to another in one shot?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-2624268387220761013</id><published>2013-05-05T03:24:00.000-07:00</published><updated>2013-05-05T03:28:09.825-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arrays"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Multidimensional Arrays"/><title type='text'>How to allocate memory for a multidimensional array dynamically?</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-family: Verdana, sans-serif;&quot;&gt;Many times we need to allocate memory for a multidimensional
array dynamically. Because of complexity of pointers many find this difficult.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Following program allocates memory for a 3 x 3 array dynamically, copies
contents of a 3 x 3 array in it and prints the contents using the pointer.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;new.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;int a[ ][3] = {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1, 2, 3,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4, 5, 6,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7, 8, 9&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;void main( )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;int **p;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;p = new int *[3] ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for ( int i = 0 ; i &amp;lt; 3 ; i++ )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p[i] = new int[3];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for ( i = 0 ; i &amp;lt; 3 ; i++ )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for ( int j = 0 ; j &amp;lt; 3 ; j++ )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p[i][j] = a[i][j] ;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for ( i = 0 ; i &amp;lt; 3 ; i++ )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for ( j = 0 ; j &amp;lt; 3 ; j++ )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; p[i][j] ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;\n&quot; ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/2624268387220761013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-to-allocate-memory-for.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2624268387220761013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2624268387220761013'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-to-allocate-memory-for.html' title='How to allocate memory for a multidimensional array dynamically?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-7627899726320194828</id><published>2013-05-05T03:17:00.003-07:00</published><updated>2013-05-05T03:19:12.579-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="const"/><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><category scheme="http://www.blogger.com/atom/ns#" term="Mutable"/><title type='text'>How do I change a data member of the const object?</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-family: Verdana, sans-serif;&quot;&gt;To change the data members of the &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;const&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
object the data members are declared as &lt;/span&gt;&lt;b style=&quot;font-family: Verdana, sans-serif;&quot;&gt;mutable&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt; in the class.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is
shown in the following example:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;class sample&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; private : &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mutable int i; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; public : &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sample( int ii = 0 )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i = ii;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; void fun( ) const&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i++;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout&amp;lt;&amp;lt; i;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;void main( )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;const sample s ( 15 ) ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;s.fun( );&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;} &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Here, the object &lt;b&gt;s&lt;/b&gt; is &lt;b&gt;const&lt;/b&gt; and hence only &lt;b&gt;const&lt;/b&gt;
functions can operate upon it. When the &lt;b&gt;const&lt;/b&gt; function &lt;b&gt;fun( )&lt;/b&gt;
gets called to operate upon object &lt;b&gt;s&lt;/b&gt;, the data member &lt;b&gt;i&lt;/b&gt; is
incremented. Ideally the data member should not be changed, as object is
defined &lt;b&gt;const&lt;/b&gt;. But we can change the data member &lt;b&gt;i&lt;/b&gt; because it is
declared as &lt;b&gt;mutable&lt;/b&gt; in the class &lt;b&gt;sample&lt;/b&gt;&lt;/span&gt; &lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/7627899726320194828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-do-i-change-data-member-of-const.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/7627899726320194828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/7627899726320194828'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-do-i-change-data-member-of-const.html' title='How do I change a data member of the const object?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-1769013564687940721</id><published>2013-05-05T03:14:00.001-07:00</published><updated>2013-05-05T03:18:53.211-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Copy Constructor"/><category scheme="http://www.blogger.com/atom/ns#" term="CPP"/><title type='text'>Why is it necessary to use a reference in the argument to the copy constructor? </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-family: Verdana, sans-serif;&quot;&gt;If we pass the copy constructor the argument by
value, its copy would get constructed using the copy constructor. This means
the copy constructor would call itself to make this copy. This process would go
on and on until the compiler runs out of memory.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This can be explained with the
help of following example: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;class sample&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; int i; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sample (sample p)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i = p.i;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;void main( )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sample s;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;sample s1(s);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;} &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;While executing the statement &lt;b&gt;sample s1 ( s )&lt;/b&gt;, the
copy constructor would get called. As the copy construct here accepts a value,
the value of &lt;b&gt;s&lt;/b&gt; would be passed which would get collected in &lt;b&gt;p&lt;/b&gt;. We
can think of this statement as &lt;b&gt;sample p = s&lt;/b&gt;. Here &lt;b&gt;p&lt;/b&gt; is getting
created and initialized. Means again the copy constructor would get called.
This would result into recursive calls.Hence we must use a reference as an
argument in a copy constructor.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/1769013564687940721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/why-is-it-necessary-to-use-reference-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1769013564687940721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1769013564687940721'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/why-is-it-necessary-to-use-reference-in.html' title='Why is it necessary to use a reference in the argument to the copy constructor? '/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-2315794427070299315</id><published>2013-05-05T03:10:00.000-07:00</published><updated>2013-05-05T03:18:27.998-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><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="Singleton Class"/><title type='text'>How do I write code that allows to create only one instance of a class?</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-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;class sample &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static sample *ptr ; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; private: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sample( ){} &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; public: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static sample* create( )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ( ptr == NULL ) &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&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;ptr = new sample ; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return ptr;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;} ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;sample *sample::ptr = NULL ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;void main( )&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{ &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sample *a = sample::create( ) ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sample *b = sample::create( ) ; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;} &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Here, the class &lt;b&gt;sample&lt;/b&gt; contains a &lt;b&gt;static&lt;/b&gt; data
member &lt;b&gt;ptr&lt;/b&gt; which is a pointer to the object of same class. The
constructor is &lt;b&gt;private &lt;/b&gt;which avoids us from creating objects outside the
class. A &lt;b&gt;static&lt;/b&gt; member function called &lt;b&gt;create( )&lt;/b&gt; is used to
create an object of the class. In this function the condition is checked
whether or not &lt;b&gt;ptr&lt;/b&gt; is NULL, if it is then an object is created
dynamically and its address collected in &lt;b&gt;ptr&lt;/b&gt; is returned. If &lt;b&gt;ptr&lt;/b&gt;
is not NULL, then the same address is returned. Thus, in &lt;b&gt;main( )&lt;/b&gt; on
execution of the first statement one object of &lt;b&gt;sample&lt;/b&gt; gets created
whereas on execution of second statement, &lt;b&gt;b&lt;/b&gt; holds the address of the
first object. Thus, whatever number of times you call &lt;b&gt;create( )&lt;/b&gt;
function, only one object of &lt;b&gt;sample&lt;/b&gt; class will be available.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/2315794427070299315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-do-i-write-code-that-allows-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2315794427070299315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2315794427070299315'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/05/how-do-i-write-code-that-allows-to.html' title='How do I write code that allows to create only one instance of a class?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-1533199782024396429</id><published>2013-04-25T05:24:00.002-07:00</published><updated>2013-04-25T05:24:35.549-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><title type='text'>Most Commonly Used Git Commands</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-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;usage:&lt;/b&gt; git [--version] [--exec-path[=&amp;lt;path&amp;gt;]] [--html-path] [--man-path] [-- &amp;nbsp; info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] &lt;br /&gt;           [--git-dir=&amp;lt;path&amp;gt;] [--work-tree=&amp;lt;path&amp;gt;] [--namespace=&amp;lt;name&amp;gt;] &lt;br /&gt;           [-c name=value] [--help] &amp;lt;command&amp;gt; [&amp;lt;args&amp;gt;] &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;The most commonly used git commands are: &lt;br /&gt;   add &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Add file contents to the index &lt;br /&gt;   bisect &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Find by binary search the change that introduced a bug &lt;br /&gt;   branch &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List, create, or delete branches &lt;br /&gt;   checkout &amp;nbsp; &amp;nbsp; Checkout a branch or paths to the working tree &lt;br /&gt;   clone &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Clone a repository into a new directory &lt;br /&gt;   commit &amp;nbsp; &amp;nbsp; &amp;nbsp; Record changes to the repository &lt;br /&gt;   diff &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Show changes between commits, commit and working tree, etc &lt;br /&gt;   fetch &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Download objects and refs from another repository &lt;br /&gt;   grep &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Print lines matching a pattern &lt;br /&gt;   init &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Create an empty git repository or reinitialize an existing one &lt;br /&gt;   log &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Show commit logs &lt;br /&gt;   merge &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Join two or more development histories together &lt;br /&gt;   mv &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Move or rename a file, a directory, or a symlink &lt;br /&gt;   pull &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fetch from and merge with another repository or a local branch &lt;br /&gt;   push &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Update remote refs along with associated objects &lt;br /&gt;   rebase &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Forward-port local commits to the updated upstream head &lt;br /&gt;   reset &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Reset current HEAD to the specified state &lt;br /&gt;   rm &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Remove files from the working tree and from the index &lt;br /&gt;   show &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Show various types of objects &lt;br /&gt;   status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Show the working tree status &lt;br /&gt;   tag &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Create, list, delete or verify a tag object signed with GPG &lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/1533199782024396429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/most-commonly-used-git-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1533199782024396429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/1533199782024396429'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/most-commonly-used-git-commands.html' title='Most Commonly Used Git Commands'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-5749149188205405565</id><published>2013-04-24T02:41:00.000-07:00</published><updated>2013-04-24T02:42:29.269-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><category scheme="http://www.blogger.com/atom/ns#" term="Git Setup"/><title type='text'>Git: Installation &amp; Setup</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-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Installation:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1) Ubuntu,debian&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sudo apt-get install git-core&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2) Fedora,red hat&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yum install git&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;3) Windows&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;http://code.google.com/p/msysgit/ &lt;br /&gt;4) Mac OS&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;http://code.google.com/p/git-osx-installer&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;Setting up Git:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;When you first start using Git, there are a few things you will likely want to get setup before you start. Git records your name and email address when you create commits, so you need to tell Git what those are.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can use the&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Open Sans&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22.383333206176758px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #f9f9f9; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(192, 192, 192); color: #333333; font-size: 0.9em; line-height: 22.383333206176758px; padding: 2px 5px;&quot;&gt;git config&lt;/code&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Open Sans&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22.383333206176758px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;command to set those. If you pass&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Open Sans&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22.383333206176758px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #f9f9f9; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(192, 192, 192); color: #333333; font-size: 0.9em; line-height: 22.383333206176758px; padding: 2px 5px;&quot;&gt;--global&lt;/code&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Open Sans&#39;, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22.383333206176758px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;it will save the values in the ‘~/.gitconfig’ file so they are the default for all of your repositories.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;User Configuration:&lt;/u&gt;&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ git config --global user.name &quot;Your Name&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ git config --global user.email &quot;YourMail@gmail.com&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;Push configuration:&lt;/u&gt;&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;background-color: white; font-family: Lato, arial, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;The following command configure Git so that the&amp;nbsp;&lt;/span&gt;&lt;code class=&quot;code&quot; style=&quot;background-color: white; font-size: 16px;&quot;&gt;git push&lt;/code&gt;&lt;span style=&quot;background-color: white; font-family: Lato, arial, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;&amp;nbsp;command pushes always all branches which are connected to a remote branch (configured as remote tracking branches) to your Git remote repository. This makes is typical easier to ensure that all relevant branches are pushed.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; font-family: Lato, arial, sans-serif; font-size: 16px; line-height: 24px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;# set default so that all changes are always pushed to the repository&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ git config --global push.default &quot;matching&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;Avoid merge commits for pulling:&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;div&gt;
&lt;div style=&quot;background-color: white; font-family: Lato, arial, sans-serif; font-size: 16px; line-height: 24px; margin-left: 10px; margin-right: 10px;&quot;&gt;
If you pull in changes from a remote repository, Git by default creates merge commits. This typically undesired and you can avoid this via the following setting.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Lato, arial, sans-serif; font-size: 16px; line-height: 24px; margin-left: 10px; margin-right: 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Lato, arial, sans-serif; font-size: 16px; line-height: 24px; margin-left: 10px; margin-right: 10px;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;# set default so that you avoid unnecessary commits&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ git config --global branch.autosetuprebase always &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;Color Highlighting:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ git config --global color.ui true&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ git config --global color.status auto&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ git config --global color.branch auto &lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;u&gt; Setting the default editor:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ &amp;nbsp;git config --global core.editor vim &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/5749149188205405565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/git-installation-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/5749149188205405565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/5749149188205405565'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/git-installation-setup.html' title='Git: Installation &amp; Setup'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-4695286019232121278</id><published>2013-04-24T02:09:00.004-07:00</published><updated>2013-04-24T02:09:38.622-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><title type='text'>What is Git?</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-family: Verdana, sans-serif;&quot;&gt;Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Git allows groups of people to work on the same documents (often code) at the same time, and without stepping on each other&#39;s toes. It&#39;s a distributed version control system.&lt;br /&gt;&lt;br /&gt;Git is a distributed system, everyone has their own copy of the source codes.&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;div&gt;
&lt;b&gt;&lt;u&gt;Distributed version control system:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
A distributed version control system has not necessary a central server which stores the data.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;br /&gt;The user can copy an existing repository. This copying process is typically called cloning in a distributed version control system.&lt;br /&gt;&lt;br /&gt;Typically there is a central server for keeping a repository but each cloned repository is a full copy of this repository. The decision which of the copies is considered to be the central server repository is a pure convention and not tied to the capabilities of the distributed version control itself.&lt;br /&gt;&lt;br /&gt;Every local copy contains the full history of the collection of files and a cloned repository has the same functionality as the original repository.&lt;br /&gt;&lt;br /&gt;Every repository can exchange versions of the files with other repositories by transporting these changes. This is typically done via the selected central server repository.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/4695286019232121278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/what-is-git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/4695286019232121278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/4695286019232121278'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/what-is-git.html' title='What is Git?'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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-4467996862831967117.post-2563575260425466967</id><published>2013-04-23T22:08:00.002-07:00</published><updated>2013-04-23T22:08:42.846-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="C Programs"/><title type='text'> C Program to Print a pyramid string triangle</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-family: Verdana, sans-serif;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;  &lt;br /&gt;#include &amp;lt;string.h&amp;gt; &lt;br /&gt;  int main() &lt;br /&gt;  {  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int i,j,length;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;char arr[] = &quot;Programming&quot;; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;length = strlen(arr); &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (i = length; i &amp;gt;= 0; i--)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf(&quot;\n&quot;);  &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (j = 0; j&amp;lt; i; j++) &lt;br /&gt;&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; printf(&quot;%c&quot;,arr[j]);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return 0;&lt;br /&gt;}&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Output:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Programming&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Programmin&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Programmi&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Programm&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Program&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Progra&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Progr&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Prog&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Pro&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Pr&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;P&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ccppcoding.blogspot.com/feeds/2563575260425466967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/c-program-to-print-pyramid-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2563575260425466967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4467996862831967117/posts/default/2563575260425466967'/><link rel='alternate' type='text/html' href='http://ccppcoding.blogspot.com/2013/04/c-program-to-print-pyramid-string.html' title=' C Program to Print a pyramid string triangle'/><author><name>Chaitanya</name><uri>http://www.blogger.com/profile/03122096411431331346</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>