<?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-1429823635422656199</id><updated>2024-10-24T20:47:51.702+05:30</updated><category term="c++"/><category term="General"/><category term="geek fun"/><category term="Qt"/><category term="algorithm"/><category term="ash"/><category term="book"/><category term="flipkart"/><category term="memory"/><category term="projects"/><category term="template"/><title type='text'>Cpp Soup</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-8985651933120857441</id><published>2012-08-10T02:31:00.001+05:30</published><updated>2012-08-10T02:31:46.763+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="geek fun"/><title type='text'>Two very annoying mistakes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I am very good at doing&amp;nbsp;silly&amp;nbsp;mistakes in c++ syntax. Here are two of the most disturbing mistakes.&lt;br /&gt;
1. Forgetting to put ; after class declaration :&lt;br /&gt;
&amp;nbsp; &amp;nbsp;class mb&lt;br /&gt;
&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int a;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; Error : &amp;nbsp;&quot;expected unqualified-id at end of input&quot;&lt;br /&gt;
&lt;br /&gt;
2. Forgetting to leave a space after &quot;&amp;gt;&quot; in map declaration.&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;map&amp;lt;string,vector&amp;lt;double&amp;gt;&amp;gt; *a;&lt;br /&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Error&amp;nbsp;: ‘&amp;gt;&amp;gt;’ should be ‘&amp;gt; &amp;gt;’ within a nested template argument list&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Correct syntax :&amp;nbsp;map&amp;lt;string,vector&amp;lt;double&amp;gt; &amp;gt; *a;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The second one is more annoying . It made me google many a times :)&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/8985651933120857441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/08/two-very-annoying-mistakes.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/8985651933120857441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/8985651933120857441'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/08/two-very-annoying-mistakes.html' title='Two very annoying mistakes'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-4574571758604584811</id><published>2012-08-09T23:55:00.000+05:30</published><updated>2012-08-09T23:55:06.363+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="memory"/><title type='text'>Limiting memory use to a % of total memory</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
One of my friend was very annoyed with his application. He thinks there is one unknown process which occasionally eats up total memory available. So he was asking , if there is some way to limit memory usage to a predefined portion of total available memory. I googled , and most people say this is indeed a very very bad idea. Applications should not measure ram and occupy. If ten applications are coded, such that they occupy 1/4th of ram, and they are ran together, then crash is inevitable. In the process I learnt a way to get memory related stats on a unix system. Just parse the file at &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #cccccc;&quot;&gt;/proc/meminfo&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimvRqch6_v2vEsLYpREk98WckLUxYM5nMHuN306Ag3cRmHdoaH9VgvOSqL0IrKIvMPy8xMm96PCI4WeTROAzsfI88mdngXRiJea7q6H3uWsCapUdXMOaNTJX23PcAfjGehVdQJclok4qJ0/s1600/mem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimvRqch6_v2vEsLYpREk98WckLUxYM5nMHuN306Ag3cRmHdoaH9VgvOSqL0IrKIvMPy8xMm96PCI4WeTROAzsfI88mdngXRiJea7q6H3uWsCapUdXMOaNTJX23PcAfjGehVdQJclok4qJ0/s320/mem.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
{Used cat to see meminfo}&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Otherwise &amp;nbsp;a system wide setting can also be changed using &lt;a href=&quot;http://www.linuxhowtos.org/Tips%20and%20Tricks/ulimit.htm&quot; target=&quot;_blank&quot;&gt;ulimit&lt;/a&gt; . &amp;nbsp;For more info &lt;a href=&quot;http://www.linuxhowtos.org/Tips%20and%20Tricks/ulimit.htm&quot; target=&quot;_blank&quot;&gt;read here&lt;/a&gt;. {Read the warnings at bottom first.}&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/4574571758604584811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/08/limiting-memory-use-to-of-total-memory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/4574571758604584811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/4574571758604584811'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/08/limiting-memory-use-to-of-total-memory.html' title='Limiting memory use to a % of total memory'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimvRqch6_v2vEsLYpREk98WckLUxYM5nMHuN306Ag3cRmHdoaH9VgvOSqL0IrKIvMPy8xMm96PCI4WeTROAzsfI88mdngXRiJea7q6H3uWsCapUdXMOaNTJX23PcAfjGehVdQJclok4qJ0/s72-c/mem.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-3186930941294044162</id><published>2012-08-07T23:18:00.000+05:30</published><updated>2012-08-07T23:18:03.275+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="algorithm"/><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Double linked list using single pointer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
At first I thought it&#39;s impossible . After all a pointer can point to one memory location at a time, But then I read this insightful discussion on &lt;a href=&quot;http://stackoverflow.com/questions/1755056/how-to-implement-a-double-linked-list-with-only-one-pointer?rq=1&quot; target=&quot;_blank&quot;&gt;stackoverflow&lt;/a&gt;.&amp;nbsp;&amp;nbsp; And here is a possible solution to the problem &lt;a href=&quot;http://everything2.com/title/Storing+a+doubly-linked+list+using+just+a+single+pointer+field&quot; target=&quot;_blank&quot;&gt;http://everything2.com/title/Storing+a+doubly-linked+list+using+just+a+single+pointer+field &lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/3186930941294044162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/08/double-linked-list-using-single-pointer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3186930941294044162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3186930941294044162'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/08/double-linked-list-using-single-pointer.html' title='Double linked list using single pointer'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-518460345141089325</id><published>2012-05-12T16:23:00.000+05:30</published><updated>2012-05-12T16:23:37.846+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="geek fun"/><title type='text'>Funny C++ Declarations</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was browsing through GNU website and I found a page full of fun. Here are some examples from that page...&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;1. struct dumb by[sizeof member];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;2. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;struct by_lightning;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;3. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;short circuit;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;4. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;void if_removed();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;5. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;unsigned check;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;6. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;class dismissed : public annoyance &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;7. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #35382a; font-family: monospace; font-size: 16px; line-height: 20px; white-space: pre;&quot;&gt;long trousers_with_holes;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #35382a; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 20px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #35382a; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 20px; white-space: pre;&quot;&gt;For more fun head to source &lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.gnu.org/fun/jokes/declarations.html&quot;&gt;http://www.gnu.org/fun/jokes/declarations.html&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/518460345141089325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/funny-c-declarations.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/518460345141089325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/518460345141089325'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/funny-c-declarations.html' title='Funny C++ Declarations'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>1</thr:total><georss:featurename>BTM Layout 2nd Stage, Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9128118 77.6092188</georss:point><georss:box>12.8973348 77.5894778 12.9282888 77.62895979999999</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-480089989652397388</id><published>2012-05-12T11:22:00.000+05:30</published><updated>2012-05-12T11:22:06.797+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="book"/><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="flipkart"/><title type='text'>Finding a book on Design Pattern</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
So far I have used singleton and factory model. But my understandings on design patterns are&amp;nbsp;limited. So I decided to go in depth into it. I followed my usual book searching procedure...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
1. Search in google and go through plenty of blog posts for book suggestions and review. Gather some names.&lt;br /&gt;
&lt;br /&gt;
2. Next come to stack overflow and check what book they are gossiping about?&lt;br /&gt;
&lt;br /&gt;
3. Now take out the common names and head to google books.&lt;br /&gt;
&lt;br /&gt;
4. Here you can see preview of your books along with websites in your country, who actually sell them.&lt;br /&gt;
&lt;br /&gt;
5. One draw back here is price comparison is not shown on google book. So you have to&amp;nbsp;manually&amp;nbsp;visit each and every site to find the best deal. My personal&amp;nbsp;favorite&amp;nbsp;is &lt;a href=&quot;http://flipkart.com/&quot;&gt;flipkart.com&lt;/a&gt;&amp;nbsp;, just because of the quality of their service.&lt;br /&gt;
&lt;br /&gt;
I have found 4 books interesting.&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 19px; font-weight: bold;&quot;&gt;&lt;a href=&quot;http://www.flipkart.com/refactoring-0201485672/p/itmczyu3chfgheyz?pid=9780201485677&amp;amp;_l=gWxQa0snNjHUHKJhnj_y0w--&amp;amp;_r=11aUf5QGgkyUOHV8jjDOwQ--&quot; target=&quot;_blank&quot;&gt;Refactoring: Improving the Design of Existing Code&lt;/a&gt; :&lt;/span&gt;&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; It&#39;s a classic book and praised by almost everyone. But some complained that it&#39;s a bit dated.&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 19px; font-weight: bold;&quot;&gt;&lt;a href=&quot;http://www.flipkart.com/clean-code-0132350882/p/itmczyqgcqtqgwck?pid=9780132350884&amp;amp;_l=CjBrRcwxOtEruK3Rz93zIA--&amp;amp;_r=BPc98pj9P22av7TK%20X%20b5g--&amp;amp;ref=acb3cd69-9f7b-4b75-8c6e-09e9f512181c&quot; target=&quot;_blank&quot;&gt;Clean Code: A Handbook of Agile Software Craftsmanship&lt;/a&gt; :&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 19px; font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif;&quot;&gt; &amp;nbsp;My guess is this one will give more value for money than any other choices. It talks about a &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;more wider subject.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif;&quot;&gt;&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
3.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 19px; font-weight: bold;&quot;&gt;&lt;a href=&quot;http://www.flipkart.com/head-first-design-patterns-8173664668/p/itmdykh9jqtghffd?pid=9788173664663&amp;amp;_l=gWxQa0snNjHUHKJhnj_y0w--&amp;amp;_r=TNtMFLia6ESIt_fz2eL3YA--&amp;amp;ref=e4bbb576-acbd-4933-ba9f-1d023a304177&quot; target=&quot;_blank&quot;&gt;Head First Design Patterns&lt;/a&gt; : &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif;&quot;&gt;This one looks catchy. Just like other books in this series, it attempts to explain all complex stuffs in a visual manner. I guess I will settle for this :)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;trebuchet MS&#39;, &#39;lucida grande&#39;, tahoma, verdana, arial, sans-serif; font-size: 19px; font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/480089989652397388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/finding-book-on-design-pattern.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/480089989652397388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/480089989652397388'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/finding-book-on-design-pattern.html' title='Finding a book on Design Pattern'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>2</thr:total><georss:featurename>Grant Rd, Sampangi Rama Nagar, Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9715987 77.5945627</georss:point><georss:box>12.724026199999999 77.2787057 13.2191712 77.910419699999991</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-6727773355827709965</id><published>2012-05-12T09:50:00.001+05:30</published><updated>2012-05-12T09:50:34.431+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><title type='text'>Why not to use void main</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;In college, while using turbo c, we learn to use &quot;void main()&quot;. But this is against c++ standard. Actually this shouldn&#39;t compile. Main function must return a int value. Main function should be declared like &quot;Int main()&quot;. And at the end &quot;return 0&quot; may be added to indicate that function executed successfully. It may return 1 in order to indicate that some error has&amp;nbsp;occurred. This is also&amp;nbsp;referred&amp;nbsp;as Exit Status. It can be&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px; line-height: 19px;&quot;&gt;&lt;code style=&quot;background-color: #f9f9f9;&quot;&gt;EXIT_SUCCESS&lt;/code&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 19px;&quot;&gt;(traditionally 0) and&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px; line-height: 19px;&quot;&gt;&amp;nbsp;&lt;code style=&quot;background-color: #f9f9f9;&quot;&gt;EXIT_FAILURE&lt;/code&gt;. &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 19px;&quot;&gt;If return is not provided by programmer, it will return 0 by default.&lt;/span&gt;&amp;nbsp; For other exit statuses you may have a look in stdlib.h(cstdlib).&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/6727773355827709965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/why-not-to-use-void-main.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/6727773355827709965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/6727773355827709965'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/why-not-to-use-void-main.html' title='Why not to use void main'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-3700657738646264918</id><published>2012-05-11T00:25:00.001+05:30</published><updated>2012-05-11T00:25:41.836+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="Qt"/><title type='text'>QVector Advantages</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.385; margin-bottom: 18px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
In our workplace &amp;nbsp;we use stl as much as possible. Even when coding in qt we are advised to import and use stl containers. I googled this issue to know justifications behind this favourism. What I found is STL is a clear winner if speed is single most important concern. On the other hand qtl has many advantages of it’s own. Let me elaborate these points with an example of vector. QVector is more easier to use than stl::vector. Qvectors are more light weight. Whenever we copy or pass qvector , only a pointer to vector is passed. A deepcopy is used only when editing data. QVector occupies more memory to prevent use of memory allocation operations each and every time expansion is required. It uses realloc() to grow by increments of 4096 bytes. Qvector has lots of interesting functions to make the life easier for developers. It has a squeeze option to remove extra spaces allocated. So I believe it’s advisable to use qvector as much as possible. And in case you want to use stl:: vector , you can always convert to stl::vector like this&lt;/div&gt;
&lt;pre style=&quot;background-color: #f9f7f5; font-size: 1em; line-height: 22px; margin-bottom: 10px; margin-top: 10px; overflow-x: auto; overflow-y: auto; padding-bottom: 1em; padding-left: 10px; padding-right: 10px; padding-top: 1em;&quot;&gt; QVector vector;
 vector &amp;lt;&amp;lt; 1.2 &amp;lt;&amp;lt; 0.5 &amp;lt;&amp;lt; 3.14;
 std::vector stdvector = vector.toStdVector();  
&lt;/pre&gt;
&lt;div style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.385; margin-bottom: 18px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
(reference &lt;a href=&quot;http://doc.qt.nokia.com/4.7/qvector.html&quot;&gt;http://doc.qt.nokia.com/4.7/qvector.html&lt;/a&gt;)&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/3700657738646264918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/in-our-workplace-use-stl-as-much-as.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3700657738646264918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3700657738646264918'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/in-our-workplace-use-stl-as-much-as.html' title='QVector Advantages'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-3894438940072913212</id><published>2012-05-11T00:22:00.000+05:30</published><updated>2012-05-11T00:22:09.223+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><title type='text'>Assignment operator in RVALUE</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;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot;&gt;I came across a line of code which looked a bit strange to me. It reads like this..&lt;/span&gt;&lt;br style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot; /&gt;&lt;code style=&quot;background-color: #f9f7f5; font-family: Consolas, &#39;Courier New&#39;, sans-serif; font-size: 1.1em; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; padding-top: 2px;&quot;&gt;x= m * (n=7);&lt;/code&gt;&lt;br style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot; /&gt;&lt;span style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot;&gt;The above code is actually equivalent to&lt;/span&gt;&lt;br style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot; /&gt;&lt;code style=&quot;background-color: #f9f7f5; font-family: Consolas, &#39;Courier New&#39;, sans-serif; font-size: 1.1em; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; padding-top: 2px;&quot;&gt;n=7&lt;br /&gt;x=m*n&lt;/code&gt;&lt;br style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot; /&gt;&lt;span style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot;&gt;Actually c++ supports using assignments on the right hand side of assignments operator. And we are all familiar with that. I bet you must have seen assignments like this…&lt;/span&gt;&lt;br style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot; /&gt;&lt;code style=&quot;background-color: #f9f7f5; font-family: Consolas, &#39;Courier New&#39;, sans-serif; font-size: 1.1em; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; padding-top: 2px;&quot;&gt;a=b=c;&lt;/code&gt;&lt;br style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot; /&gt;&lt;span style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px;&quot;&gt;This and the previous code follows the same rule.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/3894438940072913212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/assignment-operator-in-rvalue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3894438940072913212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3894438940072913212'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/assignment-operator-in-rvalue.html' title='Assignment operator in RVALUE'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-1547368268928583639</id><published>2012-05-11T00:20:00.001+05:30</published><updated>2012-05-11T00:20:23.219+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><title type='text'>Calling constructor from constructor</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.385; margin-bottom: 18px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
I was trying a few whiteboard programs, just for fun. In one of them I called a&amp;nbsp;constructor&amp;nbsp;from within another constructor. Code compiled&amp;nbsp;without&amp;nbsp;any fuss,but code&amp;nbsp;didn’t worked the way I was expecting. &amp;nbsp;I found out that when calling a constructor from within a constructor a temporary unnamed constructor is created. That is the reason why program is not behaving the way I was expecting. Check out this…&lt;br /&gt;&lt;code style=&quot;background-color: #e9ebd9; color: black; font-family: Consolas, &#39;Courier New&#39;, sans-serif; font-size: 1.1em; line-height: normal; padding-bottom: 2px; padding-left: 3px; padding-right: 3px; padding-top: 2px;&quot;&gt;&lt;span id=&quot;more-44&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; line-height: 1.385; margin-bottom: 18px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;i&gt;&lt;br /&gt;using namespace std;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; line-height: 1.385; margin-bottom: 18px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;i&gt;class foo&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;public:&lt;br /&gt;foo()&lt;br /&gt;{&lt;br /&gt;x=20;&lt;br /&gt;}&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f9f7f5; color: #444444; font-family: Arial, Helvetica, sans-serif; line-height: 1.385; margin-bottom: 18px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;i&gt;foo(int d)&lt;br /&gt;{&lt;br /&gt;x=d;&lt;br /&gt;foo();//value should be changed to 20, but it wont&lt;br /&gt;}&lt;br /&gt;void show()&lt;br /&gt;{&lt;br /&gt;foo a;&lt;br /&gt;a.show();// will print 20&lt;br /&gt;foo b(10);&lt;br /&gt;b.show();// will print 10. I was expecting it to print 20&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
(This one is from my old blog.)&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/1547368268928583639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/calling-constructor-from-constructor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/1547368268928583639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/1547368268928583639'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/calling-constructor-from-constructor.html' title='Calling constructor from constructor'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-1832343111964388953</id><published>2012-05-10T21:54:00.001+05:30</published><updated>2012-05-10T21:54:58.375+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Constant functions and Mutable</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For a c++ rookie this syntax may look interesting ..&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;void myFunc() const;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Normally we love to see const at the&amp;nbsp;beginning&amp;nbsp;of a line . like &quot;const int i = 10;&quot;. Actually above line is perfect. It tells that the function can&#39;t modify it&#39;s calling object. It is&amp;nbsp;referred&amp;nbsp;as&amp;nbsp;read only&amp;nbsp;function in some text books. It can call some more constant functions from inside. But it can&#39;t call any normal function. &amp;nbsp;This type of functions can be called from any ordinary functions as well as constant functions.&lt;br /&gt;
&lt;br /&gt;
Suppose you want to declare a constant function, but at the same time you want it to modify some particular data. In that case you need to use mutable key word while declaring your variables.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp;mutable int x;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/1832343111964388953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/constant-functions-and-mutable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/1832343111964388953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/1832343111964388953'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/constant-functions-and-mutable.html' title='Constant functions and Mutable'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total><georss:featurename>Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9715987 77.5945627</georss:point><georss:box>12.724026199999999 77.2787057 13.2191712 77.910419699999991</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-8191248087764756337</id><published>2012-05-05T14:29:00.001+05:30</published><updated>2012-05-05T14:29:38.299+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ash"/><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><category scheme="http://www.blogger.com/atom/ns#" term="projects"/><category scheme="http://www.blogger.com/atom/ns#" term="template"/><title type='text'>A new project(Data structure)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was looking to start something new for a while. Am planning to work on a new STL like project. It&#39;s kind of template library. What we planned is using hash tables underneath a wrapper. User will use vector , map and other stuffs. Our library will save the data in a hash map. We plan to use this &lt;a href=&quot;http://code.google.com/p/google-sparsehash/&quot; target=&quot;_blank&quot;&gt;algo&lt;/a&gt;. My first stop is reading&amp;nbsp; G. M. Morton&#39;s paper on hashing. Will setup sun studio tomorrow. Lets see what comes next :) &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/8191248087764756337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/05/new-projectdata-structure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/8191248087764756337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/8191248087764756337'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/05/new-projectdata-structure.html' title='A new project(Data structure)'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total><georss:featurename>Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9715987 77.5945627</georss:point><georss:box>12.724026199999999 77.2787057 13.2191712 77.910419699999991</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-3886651709358151547</id><published>2012-02-06T20:30:00.000+05:30</published><updated>2012-02-06T20:32:34.404+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Template Usage :)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/390010_291158324261153_177370134_n.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;315&quot; src=&quot;http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/390010_291158324261153_177370134_n.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/390010_291158324261153_177370134_n.jpg&quot; target=&quot;_blank&quot;&gt;(Original source)&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/3886651709358151547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/02/template-usage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3886651709358151547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/3886651709358151547'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/02/template-usage.html' title='Template Usage :)'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-1723416149466266435</id><published>2012-02-04T03:26:00.000+05:30</published><updated>2012-02-05T14:52:18.335+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="c++"/><title type='text'>Function Pointer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;link href=&quot;http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; &lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Just like variables, functions also has their own memory addresses . So we have pointers for them too.&lt;br /&gt;
void (*fPtr)();// a void function pointer declaration which takes no args.&lt;br /&gt;
fPtr = &amp;amp;myFunc;&lt;br /&gt;
(*fPtr)();&lt;br /&gt;
&lt;br /&gt;
int (*ptr2)(int,int);// a int function pointer declaration which takes 2 int args.&lt;br /&gt;
ptr2 = &amp;amp;myOtherFunc;&lt;br /&gt;
int i=0,j=2;&lt;br /&gt;
int result = (*ptr2)(i,j);
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/1723416149466266435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/02/function-pointer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/1723416149466266435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/1723416149466266435'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/02/function-pointer.html' title='Function Pointer'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1429823635422656199.post-7176391210214778005</id><published>2012-02-04T01:42:00.000+05:30</published><updated>2012-02-05T14:50:36.232+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><title type='text'>#{Header}</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; It&#39;s late night in 4th feb. I was wasting time re inventing wheels , i mean i was working on some basic c++ codes. I have practiced them a number of times, but at present i couldn&#39;t remember them. I think it&#39;s time to make a note of all these. So I am creating this blog for myself. I will post all cpp related stuffs which i feel necessary for me. If you find this site useful, please get in touch. I would love to see you as a contributer.&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Rwik &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cppsoup.blogspot.com/feeds/7176391210214778005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cppsoup.blogspot.com/2012/02/hi-its-late-night-in-4th-feb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/7176391210214778005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1429823635422656199/posts/default/7176391210214778005'/><link rel='alternate' type='text/html' href='http://cppsoup.blogspot.com/2012/02/hi-its-late-night-in-4th-feb.html' title='#{Header}'/><author><name>Rwik</name><uri>http://www.blogger.com/profile/18365530173661992282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_EJ1QAZjN7o1yOVIkrplzsDAwRLzZtLNm2-AbHRlbQqH_EQo7dPtigHTWdU0hkdG7rJsz6n7xdwwb2ulruqP-5Vp3beiycMlnuJuh0SzQwGp88BjTOybuGkaNbFiSHOMWciglSgJLC5c8MTzbPF1eZ9d_GyRXMD1E1DfiCyrcDyOldA/s220/Photoleap_14_01_2024_19_43_23_KBHG1.jpg'/></author><thr:total>0</thr:total><georss:featurename>Bengaluru, Karnataka, India</georss:featurename><georss:point>12.9715987 77.5945627</georss:point><georss:box>12.724026199999999 77.2787057 13.2191712 77.910419699999991</georss:box></entry></feed>