<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>...:navendu:...</title>
	<atom:link href="http://www.navendu.net/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.navendu.net/wordpress</link>
	<description>Navendu&#039;s space in cyber world.</description>
	<lastBuildDate>Thu, 27 May 2010 06:21:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ladakh &#8211; Yet again</title>
		<link>http://www.navendu.net/wordpress/biking-blog/ladakh-yet-again/</link>
		<comments>http://www.navendu.net/wordpress/biking-blog/ladakh-yet-again/#comments</comments>
		<pubDate>Thu, 27 May 2010 06:21:27 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Biking Blog]]></category>
		<category><![CDATA[Fiero]]></category>
		<category><![CDATA[Ladakh]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=237</guid>
		<description><![CDATA[It is that time of the year when roads to this wonderland starts to open and time for me to pay another visit to the land of highest mountain passes.

This year its going to be a special ride, during the ride I would be   completing an association of 10year with Fiero. Together we [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/navendus/3683427245/"><img class="aligncenter" title="Snowed Chang La" src="http://farm3.static.flickr.com/2542/3683427245_d9e14fa607.jpg" alt="" width="500" height="333" /></a>It is that time of the year when roads to this wonderland starts to open and time for me to pay another visit to the land of highest mountain passes.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3704327970/"><img class="aligncenter" title="To Chang La" src="http://farm4.static.flickr.com/3512/3704327970_d412ed9aca.jpg" alt="" width="500" height="333" /></a></p>
<p>This year its going to be a special ride, during the ride I would be   completing an association of 10year with Fiero. Together we have   traversed this land of lamas thrice and hope to visit some new places   this time.</p>
<p style="text-align: left;"><a href="http://www.flickr.com/photos/navendus/4013341167/"><img class="aligncenter" title="After Khoksar" src="http://farm3.static.flickr.com/2554/4013341167_56471ff9a9.jpg" alt="" width="500" height="333" /></a>To make things a bit more  adventurous, the road  between Manali and Leh  isn&#8217;t officially opened yet (with less than 2  days left for me to ride  on it).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/biking-blog/ladakh-yet-again/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spare Parts to Carry on a Road Trip</title>
		<link>http://www.navendu.net/wordpress/guides/spare-parts-to-carry-on-a-road-trip/</link>
		<comments>http://www.navendu.net/wordpress/guides/spare-parts-to-carry-on-a-road-trip/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 11:13:29 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Ladakh]]></category>
		<category><![CDATA[Road Trip]]></category>
		<category><![CDATA[Spare Parts List]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=231</guid>
		<description><![CDATA[“I’m going on a long road trip for the first time, on my motorcycle, what all spares shall I carry?”  If you are having the above question, then read ahead.
How many times and which all parts in recent past (1month/1year/3years/10years), on your bike have failed you? Normally your answer would be “none” (that’s what [...]]]></description>
			<content:encoded><![CDATA[<p>“<em>I’m going on a long road trip for the first time, on my motorcycle, what all spares shall I carry?</em>”  If you are having the above question, then read ahead.</p>
<p>How many times and which all parts in recent past (1month/1year/3years/10years), on your bike have failed you? Normally your answer would be “none” (that’s what it will be in most of cases). But if there are some parts that have failed more than once, in recent past, add them to the list as the first items (for example HT coil on one of my motorcycle). On a well maintained (regularly serviced &amp; with all parts replaced whenever the need arises) bike, you shouldn’t have parts that would have failed frequently (here I’m talking about a bone stock bike).</p>
<p>So, if no part has failed, so far, on my bike why should I even bother to carry any spares? Well, there are certain spares that aren’t very expensive and don’t occupy too much space and aren’t too difficult to replace either BUT if they fail can land your bike in an unusable state. So, it’s better to be safe than sorry and carry them.<br />
Following is a list of such spare parts:</p>
<ul>
<li>Fuses</li>
<li>Spark Plug</li>
<li>Spark Plug Cap</li>
<li>Chain Link</li>
<li>Clutch lever</li>
<li>Clutch lever mounting clamp</li>
<li>Brake Lever</li>
<li>Brake lever mounting clamp</li>
<li>Cables: Accelerator, Clutch and Brake (if your bike runs on front drum brakes)</li>
<li>Headlamp bulb</li>
<li>Engine oil (if you are using one that is not easily available and you think during trip it will require to be changed)</li>
</ul>
<p>Other than the above mentioned carry<strong> spare set of tubes</strong> (if your bike runs on tube type tire). Even if your bike runs tubeless tire, it is better to carry a spare tube just in case the alloy wheel is damaged and starts to leak air, fitting with tube can fix the problem.</p>
<p>One point to note is that, it’s important to know how to replace the spare part that you are carrying else often it would be as good as not carrying one. So, learn to change these parts and practice before you head out on that ride which you always dreamt off.</p>
<p>Though the following items are not exactly spare parts, one should also be carrying them:</p>
<ul>
<li> Electrical wire</li>
<li>Electrical tape</li>
<li>M-seal</li>
</ul>
<p>One might ask, for a long road trip the above mentioned list is fine but <strong>what about Ladakh</strong>? My answer is, Ladakh is no different than any long road trip. Yes, the terrain is different, so is the altitude and the help on road side is rare but other than how does it matter what all parts one should carry?</p>
<p>The list is kept short to only those parts that one can carry easily and don’t need much skill to change them and if they fail you might be left stranded. Though one can carry much more parts than the above listed but then are you preparing yourself for the worse? Than what about the “adventure” part of the road trip? In that case may be use a backup vehicle or better use some other mode of travel.</p>
<p>Now, if you wonder where in my city I can find a good place to get my motorcycle prepared or learn how to replace the above mentioned parts. Though I don’t have information for many cities but I can help you with Mumbai. In Mumbai Arpan &amp; Reddy conduct sessions for leh riders free of cost and teach you basics of motorcycle maintenance. For all my long trips (including 3 Ladakh rides), my bike(s) were prepared by them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/guides/spare-parts-to-carry-on-a-road-trip/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Merry Christmas &amp; A Happy New Year</title>
		<link>http://www.navendu.net/wordpress/sundries/merry-christmas-a-happy-new-year/</link>
		<comments>http://www.navendu.net/wordpress/sundries/merry-christmas-a-happy-new-year/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 14:02:47 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Sundries]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=225</guid>
		<description><![CDATA[
Wishing you all and your near and dear ones a very Happy New Year. Another year is coming to an end and hopefully with a new year this place will be more regularly updated (something that I really wanted to do this year itself).
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="Christmas Tree" href="http://www.flickr.com/photos/navendus/4221760126/" target="_blank"><img class="alignnone" title="Christmas Tree" src="http://farm3.static.flickr.com/2495/4221760126_753185eba2.jpg" alt="" width="333" height="500" /></a></p>
<p>Wishing you all and your near and dear ones a very Happy New Year. Another year is coming to an end and hopefully with a new year this place will be more regularly updated (something that I really wanted to do this year itself).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/sundries/merry-christmas-a-happy-new-year/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mailbox #2: String Reverse and Array Bound Checking</title>
		<link>http://www.navendu.net/wordpress/computer-science/cc/mailbox-2-string-reverse-and-array-bound-checking/</link>
		<comments>http://www.navendu.net/wordpress/computer-science/cc/mailbox-2-string-reverse-and-array-bound-checking/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 10:28:45 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[C/C++ Demystified]]></category>
		<category><![CDATA[Array bound checking]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[String reverse]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=223</guid>
		<description><![CDATA[Query: How to reverse a string without using any variable. You are not even allowed to use a variable to store a string.
There has to be some temporary variables to be used, for looping over the string.
Reversing a string requires swapping first character with the last, second with second last, third with third last and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Query:</strong> How to reverse a string without using any variable. You are not even allowed to use a variable to store a string.</p>
<p>There has to be some temporary variables to be used, for looping over the string.<br />
Reversing a string requires swapping first character with the last, second with second last, third with third last and so on. Now the problem requires the string to be reversed in place (without using any other buffer to store the reversed string). So, we will have to interchange the elements in the original string buffer itself. Following is a pseudo code for the same.</p>
<blockquote><p>
i = 0;<br />
j = StringLength &#8211; 1;<br />
while (i < j) {<br />
   Swap i and j element of String<br />
   ++i;<br />
   --j;<br />
}
</p></blockquote>
<p>The swapping of the two elements can be done either using a temporary variable or using XOR operator.</p>
<p><strong>Query:</strong> “C” doesnt provide boundation checking on array but it is still able to findout the length of array using the sizeof(). Why it cannot enforce boundation checking on array?</p>
<p>The reason why C is able to find out the length of array is because the length of array is part of its type declaration. As the type of a variable is known at compile time, sizeof operator can be used to find the length of array.<br />
Faster execution speed would be one reason why C don&#8217;t do array bound checking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/computer-science/cc/mailbox-2-string-reverse-and-array-bound-checking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>First Rain Ride of 2009</title>
		<link>http://www.navendu.net/wordpress/biking-blog/short-ride-reports/first-rain-ride-of-2009/</link>
		<comments>http://www.navendu.net/wordpress/biking-blog/short-ride-reports/first-rain-ride-of-2009/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 11:29:02 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Short Ride Reports]]></category>
		<category><![CDATA["Canon 400D"]]></category>
		<category><![CDATA[Canon 18-55 f/3.5-5.6]]></category>
		<category><![CDATA[Karizma]]></category>
		<category><![CDATA[Kundalika]]></category>
		<category><![CDATA[Lonavala]]></category>
		<category><![CDATA[Mulshi]]></category>
		<category><![CDATA[Pavana]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=220</guid>
		<description><![CDATA[
My first decent rainy ride in more than 2 years, turned out to be a really good and satisfying in the end. Though I have ridden to Mumbai in the very first rains of the season, it was more of a high speed run on near perfect piece of tarmac.
In search of a decent resort [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3813652085/" target="_self"><img class="aligncenter" title="Somewhere around Kundalika" src="http://farm4.static.flickr.com/3518/3813652085_f3321f97cc.jpg" alt="" width="500" height="333" /></a></p>
<p>My first decent rainy ride in more than 2 years, turned out to be a really good and satisfying in the end. Though I have ridden to Mumbai in the very first rains of the season, it was more of a high speed run on near perfect piece of tarmac.</p>
<p>In search of a decent resort in or around Mulshi, for a family outing next weekend, I decided to visit there on a motorcycle.</p>
<p>By the time I got kitted for the ride it was lunch time, though the normal routeto Mulshi is via Chandni Chowk – Pirangut – Paud, I have been on that stretch so many times that today I was just not feeling like riding on the very same stretch. So, I head out in opposite direction on NH4. After filling more than enough fuel for the ride at Shell pump (a rare thing for me, I often land up filling lesser fuel than needed for the ride and then searching for one later) I headed towards Lonavala. After having covered some 10 odd km’s, I got bored of the tarmac and got onto a road through villages and headed towards Pavana dam.</p>
<p>It was a bumpy, slow ride all the way with lush green scenery all around me. Though it was bone dry in Pune, as soon  as I got on this road rain god welcomes me with heavy showers. All my plans of stopping to capture greenery were put on hold, thanks to rain.</p>
<p>Enjoying every water filled pothole, occasional good section of tarmac and gravel, I reach the dam. Disappointed to see it not yet fully filled. A small stop and I was heading towards Paud. Just as I started to climb, the beautiful view of Tung fort made me get off the road for some offroading on slush + green grass stretches.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3813783049/" target="_self"><img class="alignnone" title="Viewing Tung Fort" src="http://farm3.static.flickr.com/2552/3813783049_0576eff17f_m.jpg" alt="" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/navendus/3813774603/" target="_self"><img class="alignnone" title="Viewing Tung Fort" src="http://farm3.static.flickr.com/2613/3813774603_3e9ec36e2a_m.jpg" alt="" width="240" height="160" /></a></p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3814583040/" target="_self"><img class="aligncenter" title="Poser Karizma" src="http://farm4.static.flickr.com/3499/3814583040_f3d58e56ff_m.jpg" alt="" width="240" height="160" /></a></p>
<p>The ride till Paud was kinda monotonous with no rains and no great view that would made me stand up on brakes. Road conditions deteriorated soon after Paud and I was already in no mood to repeat the Paud – Mulshi stretch on my way back.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3813774103/" target="_self"><img class="aligncenter" title="Enoute Mulshi" src="http://farm3.static.flickr.com/2443/3813774103_ab277d4b73_m.jpg" alt="" width="240" height="160" /></a></p>
<p>After finishing the inspection of all the probably resorts, I was feeling hungry so pulled over for a pit stop around 3:15. Missal Pav it would be for the near empty stomach. While having food I decided to head towards Lonavala. It was almost 4pm and with bike’s chain a bit loose for my comfort and rear sprocket having a bit of play (may be rubber bushing/bearing gone), there was a distinct possibility of getting stranded in a jungle. All part and parcel of adventure on two wheels, I said and got on the bike and headed towards Tamhini.</p>
<p>The road was bit better than before but the non-stop rain was giving very little chance to bring out the camera. Just after crossing Tamhini village, I got off the road and got on the offroad section towards Amby Valley. After a decent stretch initially, consisting of broken tarmac and some gravel I got on a stretch that was mostly a layer of stones, almost till the end. With rain, jungle and hardly any civilization, I wasn’t complaining much about the road surface. After all I didn’t want to go berserk on near perfect tarmac.<br />
It was disappointing to see not too many sections of road under water, not enough water streams or over flowing rivers, as I encountered during my <a href="http://www.navendu.net/wordpress/?p=70" target="_self">last ride</a> on this section.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3813774525/" target="_self"><img class="aligncenter" title="Somewhere between Kundalika and Amby Valley" src="http://farm4.static.flickr.com/3497/3813774525_a1910c5429_m.jpg" alt="" width="240" height="160" /></a></p>
<p>Before it got anywhere close to dark I was on the tarmac section near Amby valley, twisties at its best. It was tempting me to push like crazy in search of scraping my knees against tarmac. Alas, if wishes were horses I would have been on a 223bhp machine and not a 223cc machine. In no time I was riding in thick fog, with near zero visibility, so all plans of pressing that “red” button were put to rest. Though the pace was really slow, still it was fun. After all I was still out of city limits with not much traffic to deal with.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3814583086/" target="_self"><img class="aligncenter" title="Foggy road from Amby Valley" src="http://farm3.static.flickr.com/2442/3814583086_09805de86f_m.jpg" alt="" width="240" height="160" /></a></p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/navendus/3813774321/" target="_self"><img class="alignnone" title="Foggy road from Amby Valley" src="http://farm4.static.flickr.com/3490/3813774321_51b6bd09b3_m.jpg" alt="" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/navendus/3814583248/" target="_self"><img class="alignnone" title="Foggy road from Amby Valley" src="http://farm4.static.flickr.com/3493/3814583248_c8c104fa0e_m.jpg" alt="" width="240" height="160" /></a></p>
<p>Soon the dream run came to an end, as I approached Bushi Dam. With no fog and rain around, I switched from fun mode to reach home mode. After a initial struggle to pass the long queue of cars, I somehow managed to come out on NH4. The traffic is diverted and I came out just next to the turn for Rajmachi. It was very very tempting to take the turn but with clock well past 6, it was just too late for my comfort. So, it was time to slot into top gear and finally press the “red” button to head home before it gets dark. In the end, just managed to park my bike in garage before it was pitch dark to end a much needed and entertaining ride.</p>
<p><strong>When:</strong> 8th Auguest 2009<br />
<strong>Route:</strong> Pune &#8211; Pavana Dam &#8211; Paud &#8211; Mulshi &#8211; Tamhini &#8211; Kundalika &#8211; Amby Valley &#8211; Lonavala &#8211; Pune.<br />
<strong>Distance:</strong> 213km&#8217;s<br />
<strong>Time taken:</strong> 6hrs 35min.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/biking-blog/short-ride-reports/first-rain-ride-of-2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Back from Snow Land ala Ladakh</title>
		<link>http://www.navendu.net/wordpress/sundries/back-from-snow-land-ala-ladakh/</link>
		<comments>http://www.navendu.net/wordpress/sundries/back-from-snow-land-ala-ladakh/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 12:44:41 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Sundries]]></category>
		<category><![CDATA[Chang La]]></category>
		<category><![CDATA[Ladakh]]></category>
		<category><![CDATA[Snow]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=216</guid>
		<description><![CDATA[
and I&#8217;m back, back to modern civilization.
The above picture is one that was clicked during the trip, as we climbed up Chang La after it was happily snowed for more than 30minutes. During this trip, I got to experience more than what I was looking for.
I&#8217;ll try to pen down the wonderful experience I had [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Climbing up Snowed Chang La" href="http://www.flickr.com/photos/navendus/3654008104/"><img class="aligncenter" title="Climbing up Snowed Chang La" src="http://farm3.static.flickr.com/2467/3654008104_5244ebf397.jpg" alt="" width="500" height="375" /></a></p>
<p>and I&#8217;m back, back to modern civilization.<br />
The above picture is one that was clicked during the trip, as we climbed up Chang La after it was happily snowed for more than 30minutes. During this trip, I got to experience more than what I was looking for.</p>
<p>I&#8217;ll try to pen down the wonderful experience I had during this trip as soon as possible and share them with your all soon, very soon. <img src='http://www.navendu.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/sundries/back-from-snow-land-ala-ladakh/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Out of reach</title>
		<link>http://www.navendu.net/wordpress/sundries/out-of-reach/</link>
		<comments>http://www.navendu.net/wordpress/sundries/out-of-reach/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 21:21:27 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Sundries]]></category>
		<category><![CDATA["Canon 400D"]]></category>
		<category><![CDATA[Canon 18-55 f/3.5-5.6]]></category>
		<category><![CDATA[Ladakh]]></category>
		<category><![CDATA[Pangong Tso]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=214</guid>
		<description><![CDATA[




It is not that I was very actively updating my blog here, that anyone will notice that I&#8217;m away from Internet for sometime.
Still, for those who stay in touch with me via e-mail, IM&#8217;s and other mode of communication, please note that I&#8217;ll be out of reach for next two weeks. The picture above should [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp mceIEcenter">
<dl class="wp-caption aligncenter" style="width: 510px;">
<dt class="wp-caption-dt"><a title="Pangong Tso" href="http://www.flickr.com/photos/navendus/3595113289/" target="_self"><img title="Pangong Tso" src="http://farm3.static.flickr.com/2375/3595113289_628715f489.jpg" alt="Pangong Tso" width="500" height="333" /></a></dt>
</dl>
</div>
<p>It is not that I was very actively updating my blog here, that anyone will notice that I&#8217;m away from Internet for sometime.</p>
<p>Still, for those who stay in touch with me via e-mail, IM&#8217;s and other mode of communication, please note that I&#8217;ll be out of reach for next two weeks. The picture above should give you an indication as to where I can be found, if at all. <img src='http://www.navendu.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/sundries/out-of-reach/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mailbox #1: Pointer query</title>
		<link>http://www.navendu.net/wordpress/computer-science/cc/mailbox-1-pointer-query/</link>
		<comments>http://www.navendu.net/wordpress/computer-science/cc/mailbox-1-pointer-query/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 18:32:00 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[C/C++ Demystified]]></category>
		<category><![CDATA[Pointers]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=161</guid>
		<description><![CDATA[Query: What this pointer exactly holds in this case and how it works.
int *p;
p = (int *)300;
In the above assignment statement, we are storing an integer into a pointer. Since it will not be allowed directly, hence a type casting is required.
Once the assignment is done, pointer p will contain 300 and it will be [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Query:</strong> What this pointer exactly holds in this case and how it works.</p>
<blockquote><p>int *p;<br />
p = (int *)300;</p></blockquote>
<p>In the above assignment statement, we are storing an integer into a pointer. Since it will not be allowed directly, hence a type casting is required.<br />
Once the assignment is done, pointer p will contain 300 and it will be interpreted as an address. Dereferencing the pointer p, will try to access an integer stored at address 300. The result will be garbage (unless you know what is stored at address 300). Also, the safe execution of the dereferencing statement will depend on the OS in which the code is executed. As under Linux the program will generate segment fault/core dump.</p>
<p>Read <a title="Pointer in C/C++ Part – 1" href="http://www.navendu.net/wordpress/?p=145" target="_blank">Pointer in C/C++ Part – 1</a> for more explanation.</p>
<p><strong>Query:</strong> What is this declaration ? For this printf what will be the answer and why?</p>
<blockquote><p>double *p,*q;<br />
p=(double *)4000;<br />
q=(double *)2000;<br />
printf(”%d”,p-q);</p></blockquote>
<p>For the explanation about declaration, see the above explanation.</p>
<p>In the printf() we are printing the result of subtracting two pointers of the same type. The number of memory locations between the two addresses will be 4000 – 2000 = 2000bytes. Since the size of double (as both are double pointers) is 8 bytes. The result will be 2000 / 8 = 250. Hence, printf() will print 250 as the output.</p>
<p>Read <a title="Pointer in C/C++ Part – 2" href="http://www.navendu.net/wordpress/?p=157" target="_blank">Pointer in C/C++ Part – 2</a> for more explanation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/computer-science/cc/mailbox-1-pointer-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pointer in C/C++ Part – 2</title>
		<link>http://www.navendu.net/wordpress/computer-science/cc/pointer-in-cc-part-%e2%80%93-1-2/</link>
		<comments>http://www.navendu.net/wordpress/computer-science/cc/pointer-in-cc-part-%e2%80%93-1-2/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 18:13:43 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[C/C++ Demystified]]></category>
		<category><![CDATA[Pointers]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=157</guid>
		<description><![CDATA[Having covered the basics about pointers in last article, let’s look into pointer arithmetic. The arithmetic operations that are allowed with pointers are adding/subtracting integer to/from a pointer and subtracting two pointers.
How to add/subtract integer to/from pointer?
The result of adding/subtracting an integer (‘n’) to/from a pointer will be the address of the nth element (of [...]]]></description>
			<content:encoded><![CDATA[<p>Having covered the basics about pointers in <a title="Pointer in C/C++ Part – 1" href="http://www.navendu.net/wordpress/?p=145" target="_blank">last article</a>, let’s look into pointer arithmetic. The arithmetic operations that are allowed with pointers are adding/subtracting integer to/from a pointer and subtracting two pointers.</p>
<p><strong>How to add/subtract integer to/from pointer?</strong><br />
The result of adding/subtracting an integer (‘n’) to/from a pointer will be the address of the nth element (of the same type as pointer) with address in pointer used as a base address.</p>
<p>Let’s look into this with an example. Say we have an integer (32-bit integer) pointer pointing to address 1000. Now if we want to add integer 4 to this address, what the result will be?<br />
So, we will assume address 1000 as the base address into which we will be adding integer, 4. Now, since the pointer is an integer pointer, it means at address 1000 an integer will be stored, since it’s a 32-bit integer, it will take 4 bytes. Hence, starting from address 4 byte will be used by that integer (address 1000, 1001, 1002 &amp; 1003). So, next integer will be stored only starting from address 1004, and taking 4 bytes.</p>
<p>By the above explanation we can see that since every integer takes 4 bytes, going to next valid integer, we need to increment the address by 4 bytes or 4n bytes to reach nth integer. Now, this number 4 has come from the fact that the pointer’s type was integer pointer. Had it was a character pointer, we would have to increment address by 1 byte to reach the next valid character.</p>
<p>So, we can form the following generic formula to find the result of adding an integer to an address.</p>
<p>Result = Pointer + Integer * sizeof(Value stored at Pointer Address).</p>
<p>Let’s apply this to our example:<br />
Pointer = 1000<br />
Integer = 4<br />
Value stored at Pointer Address = integer (as it is a integer pointer)<br />
Sizeof(Value stored at Pointer Address) = 4 (it is a 32-bit integer)</p>
<p>Result = 1000 + 4 * 4 = 1016.</p>
<p>If we replace addition with subtraction in the above text, we can come up with the following formula to subtract an integer from a pointer.</p>
<p>Result = Pointer &#8211; Integer * sizeof(Value stored at Pointer Address).</p>
<p>So what is the type of the value that we get as a result of adding/subtracting integer to/from pointer? The answer is, same type as the pointer which was involved in addition/subtraction operation, i.e.,  Integer pointer, in the above example.</p>
<p><strong><br />
How to subtract two pointers?<br />
</strong>Two pointers of same or different types can be subtracted from each other. Though, normally we subtract pointers of same type only.</p>
<p>In short, subtracting two pointers of same type tells us how many elements of the type of pointers can be stored between those two addresses. In case we subtract two pointers of different types, the result is number of elements, of largest type (type that needs more memory) of pointer, that can be stored between two addresses.</p>
<p>The type of value returned by subtracting two pointers is of type integer, as it gives us the element count.</p>
<p>Let’s subtract two pointers of the same type. Say the two pointers are pA and pB with addresses 2000 and 1000 and their types are integer pointers. So, if we do pB – pA. The result should be number of integers that can be stored between 2000 and 1000. Since the memory locations between 2000 and 1000 are 1000 and each integer takes 4 bytes (32-bit integer). Number of integers that can fit in 1000bytes will be 1000/4 = 250. So, if we subtract two integer pointers with addresses 2000 and 1000, the result will be 25.</p>
<p>Now, the above can be put in a generic formula as follows.<br />
Result = (PointerA – PointerB)/sizeof(Value stored at PointerA or PointerB).</p>
<p>Now, let’s look at the case where the two pointers are of different types, say pA is character pointer and pB is short integer pointer. Since size of a character is 1byte and size of short integer is 2bytes, the result of subtraction will tell us how many short integers can be stored in between the two pointers getting subtracted. Since there are 1000 memory locations between two pointers, the result will be 1000/2 = 500.</p>
<p>Now, the above can be put in a generic formula as follows.<br />
Result = (PointerA – PointerB)/MAX(sizeof(Value stored at PointerA), sizeof(Value stored at PointerB)).</p>
<p>Similar topics<br />
<a title="Pointer in C/C++ Part – 1" href="http://www.navendu.net/wordpress/?p=145" target="_blank">Pointer in C/C++ Part – 1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/computer-science/cc/pointer-in-cc-part-%e2%80%93-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In &amp; Around Lavasa</title>
		<link>http://www.navendu.net/wordpress/site-feedback/in-around-lavasa/</link>
		<comments>http://www.navendu.net/wordpress/site-feedback/in-around-lavasa/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 11:30:02 +0000</pubDate>
		<dc:creator>Navendu</dc:creator>
				<category><![CDATA[Feedback]]></category>
		<category><![CDATA[Short Ride Reports]]></category>
		<category><![CDATA["Canon 10-22 f/3.5-4.5"]]></category>
		<category><![CDATA["Canon 400D"]]></category>
		<category><![CDATA["Canon 70-200 f/4 L"]]></category>
		<category><![CDATA[Hero Honda CBZ]]></category>
		<category><![CDATA[Lavasa]]></category>
		<category><![CDATA[Temghar]]></category>
		<category><![CDATA[Warasgaon]]></category>

		<guid isPermaLink="false">http://www.navendu.net/wordpress/?p=154</guid>
		<description><![CDATA[
After spending almost entire night @ office, I dumped the idea of hitting bed. Started in dark towards Lavasa to greet Sun a very good morning. Also got a chance to ride my bike into Lavasa township. Picture from a wonderful morning.
View from Lavasa Top, just before Sun was about to come out.

It was not [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a class="aligncenter" title="Sunrise viewed through wild flowers." href="http://www.flickr.com/photos/navendus/3279450384/" target="_blank"><img class="aligncenter" title="Sunrise viewed through wild flowers." src="http://farm4.static.flickr.com/3498/3279450384_b40d64eea1.jpg" alt="Sunrise viewed through wild flowers." width="500" height="333" /></a></p>
<p>After spending almost entire night @ office, I dumped the idea of hitting bed. Started in dark towards Lavasa to greet Sun a very good morning. Also got a chance to ride my bike into Lavasa township. Picture from a wonderful morning.</p>
<p>View from Lavasa Top, just before Sun was about to come out.<br />
<a class="aligncenter" title="View from Lavasa Top, just before Sun was about to come out." href="http://www.flickr.com/photos/navendus/3278627579/" target="_blank"><img class="aligncenter" title="View from Lavasa Top, just before Sun was about to come out." src="http://farm4.static.flickr.com/3312/3278627579_d5c5c8dd04_m.jpg" alt="View from Lavasa Top, just before Sun was about to come out." width="240" height="160" /></a></p>
<p>It was not just me but moon also waiting to greet Sun.<br />
<a class="aligncenter" title="It was not just me but moon also waiting to greet Sun." href="http://www.flickr.com/photos/navendus/3284238092/" target="_blank"><img class="aligncenter" title="It was not just me but moon also waiting to greet Sun." src="http://farm4.static.flickr.com/3293/3284238092_fc2148d502_m.jpg" alt="It was not just me but moon also waiting to greet Sun." width="240" height="160" /></a></p>
<p>First view of the sun as it come out to brighten up the sky.<br />
<a class="aligncenter" title="First view of the sun as it come out to brighten up the sky." href="http://www.flickr.com/photos/navendus/3284238020/" target="_blank"><img class="aligncenter" title="First view of the sun as it come out to brighten up the sky." src="http://farm4.static.flickr.com/3426/3284238020_c633c672f9_m.jpg" alt="First view of the sun as it come out to brighten up the sky." width="240" height="160" /></a></p>
<p>Watching Sun rise from Lavasa top.<br />
<a class="aligncenter" title="Watching Sun rise from Lavasa top." href="http://www.flickr.com/photos/navendus/3284238394/" target="_blank"><img class="aligncenter" title="Watching Sun rise from Lavasa top." src="http://farm4.static.flickr.com/3313/3284238394_20ed59e89a_m.jpg" alt="Watching Sun rise from Lavasa top." width="240" height="160" /></a> <a class="aligncenter" title="Watching Sun rise from Lavasa top." href="http://www.flickr.com/photos/navendus/3283416241/" target="_blank"><img class="aligncenter" title="Watching Sun rise from Lavasa top." src="http://farm4.static.flickr.com/3558/3283416241_d11958011f_m.jpg" alt="Watching Sun rise from Lavasa top." width="240" height="160" /></a></p>
<p>Viewing Sun through leaves of a tree.<br />
<a class="aligncenter" title="Viewing Sun through leaves of a tree." href="http://www.flickr.com/photos/navendus/3283416339/" target="_blank"><img class="aligncenter" title="Viewing Sun through leaves of a tree." src="http://farm4.static.flickr.com/3139/3283416339_83b47ee09d_m.jpg" alt="Viewing Sun through leaves of a tree." width="240" height="160" /></a></p>
<p>Temghar Dam backwaters view from road to Lavasa city.<br />
<a class="aligncenter" title="Temghar Dam backwaters view from road to Lavasa city." href="http://www.flickr.com/photos/navendus/3283416173/" target="_blank"><img class="aligncenter" title="Temghar Dam backwaters view from road to Lavasa city." src="http://farm4.static.flickr.com/3281/3283416173_9a631aa929_m.jpg" alt="Temghar Dam backwaters view from road to Lavasa city." width="240" height="160" /></a></p>
<p>Standing on the banks of warasgaon dam backwaters.<br />
<a class="aligncenter" title="Standing on the banks of warasgaon dam backwaters." href="http://www.flickr.com/photos/navendus/3284238226/" target="_blank"><img class="aligncenter" title="Standing on the banks of warasgaon dam backwaters." src="http://farm4.static.flickr.com/3558/3284238226_51166c7ff4_m.jpg" alt="Standing on the banks of warasgaon dam backwaters." width="160" height="240" /></a></p>
<p>Warasgaon Dam backwater as viewed from Lavasa City.<br />
<a class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." href="http://www.flickr.com/photos/navendus/3284234674/" target="_blank"><img class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." src="http://farm4.static.flickr.com/3644/3284234674_c2880647da_m.jpg" alt="Warasgaon Dam backwater as viewed from Lavasa City." width="240" height="160" /></a> <a class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." href="http://www.flickr.com/photos/navendus/3284234510/" target="_blank"><img class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." src="http://farm4.static.flickr.com/3314/3284234510_ba3fe9be62_m.jpg" alt="Warasgaon Dam backwater as viewed from Lavasa City." width="240" height="160" /></a> <a class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." href="http://www.flickr.com/photos/navendus/3283412511/" target="_blank"><img class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." src="http://farm4.static.flickr.com/3222/3283412511_c35ce8bef8_m.jpg" alt="Warasgaon Dam backwater as viewed from Lavasa City." width="240" height="160" /></a> <a class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." href="http://www.flickr.com/photos/navendus/3284234406/" target="_blank"><img class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." src="http://farm4.static.flickr.com/3610/3284234406_b4d4215042_m.jpg" alt="Warasgaon Dam backwater as viewed from Lavasa City." width="240" height="160" /></a> <a class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." href="http://www.flickr.com/photos/navendus/3283412439/" target="_blank"><img class="aligncenter" title="Warasgaon Dam backwater as viewed from Lavasa City." src="http://farm4.static.flickr.com/3391/3283412439_d90682c7ef_m.jpg" alt="Warasgaon Dam backwater as viewed from Lavasa City." width="240" height="160" /></a></p>
<p>Twisties &#8211; No matter how much you have them, you always want more.<br />
<a class="aligncenter" title="Twisties - No matter how much you have them, you always want more." href="http://www.flickr.com/photos/navendus/3283416739/" target="_blank"><img class="aligncenter" title="Twisties - No matter how much you have them, you always want more." src="http://farm4.static.flickr.com/3274/3283416739_f06c9a0074_m.jpg" alt="Twisties - No matter how much you have them, you always want more." width="240" height="160" /></a> <a class="aligncenter" title="Twisties - No matter how much you have them, you always want more." href="http://www.flickr.com/photos/navendus/3283416125/" target="_blank"><img class="aligncenter" title="Twisties - No matter how much you have them, you always want more." src="http://farm4.static.flickr.com/3211/3283416125_7a425a394a_m.jpg" alt="Twisties - No matter how much you have them, you always want more." width="240" height="160" /></a></p>
<p>CBZ Standing at the bottom of Lavasa township. Towards Warasgaon end.<br />
<a class="aligncenter" title="CBZ Standing at the bottom of Lavasa township. Towards Warasgaon end." href="http://www.flickr.com/photos/navendus/3278627739/" target="_blank"><img class="aligncenter" title="CBZ Standing at the bottom of Lavasa township. Towards Warasgaon end." src="http://farm4.static.flickr.com/3481/3278627739_614e8610c6_m.jpg" alt="CBZ Standing at the bottom of Lavasa township. Towards Warasgaon end." width="240" height="160" /></a></p>
<p>Standing in Lavasa city.<br />
<a class="aligncenter" title="Standing in Lavasa city." href="http://www.flickr.com/photos/navendus/3283416495/" target="_blank"><img class="aligncenter" title="Standing in Lavasa city." src="http://farm4.static.flickr.com/3406/3283416495_974a1796ef_m.jpg" alt="Standing in Lavasa city." width="240" height="160" /></a> <a class="aligncenter" title="Standing in Lavasa city." href="http://www.flickr.com/photos/navendus/3284238270/" target="_blank"><img class="aligncenter" title="Standing in Lavasa city." src="http://farm4.static.flickr.com/3212/3284238270_bbf88cb8c7_m.jpg" alt="Standing in Lavasa city." width="240" height="160" /></a></p>
<p>While I was sipping on Tea, I found this young chap making the most of the early morning warm Sun rays.<br />
<a class="aligncenter" title="While I was sipping on Tea, I found this young chap making the most of the early morning warm Sun rays." href="http://www.flickr.com/photos/navendus/3279450330/" target="_blank"><img class="aligncenter" title="While I was sipping on Tea, I found this young chap making the most of the early morning warm Sun rays." src="http://farm4.static.flickr.com/3531/3279450330_182b239dc4_m.jpg" alt="While I was sipping on Tea, I found this young chap making the most of the early morning warm Sun rays." width="240" height="160" /></a></p>
<p><em>Click on image to view in bigger size.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.navendu.net/wordpress/site-feedback/in-around-lavasa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
