<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Darshan Shah on Medium]]></title>
        <description><![CDATA[Stories by Darshan Shah on Medium]]></description>
        <link>https://medium.com/@darshan_shah?source=rss-b3bd8b56d211------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hiE4G7JpO3Ltsn_a.</url>
            <title>Stories by Darshan Shah on Medium</title>
            <link>https://medium.com/@darshan_shah?source=rss-b3bd8b56d211------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:41:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@darshan_shah/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Navratri Week — 2019]]></title>
            <link>https://medium.com/@darshan_shah/navratri-week-2019-87a88e7747a6?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/87a88e7747a6</guid>
            <category><![CDATA[livelovedance]]></category>
            <category><![CDATA[dance]]></category>
            <category><![CDATA[dandiya-dance]]></category>
            <category><![CDATA[garba]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Mon, 28 Oct 2019 18:55:22 GMT</pubDate>
            <atom:updated>2019-10-28T19:02:37.193Z</atom:updated>
            <content:encoded><![CDATA[<h3>Navratri Week — 2019</h3><p>Quick rewind of the Navratri Week of 2019.</p><h3>Attended Workshop at Forum Neighbourhood Mall</h3><p>Attended Garba/Dandiya Workshop organized by SIGA (Shri Indiranagar Gujarati Association) at Forum Neighbourhood Mall, Whitefield (for a quick refresher and to get back into the Garba groove)</p><p>Had few friends from the dance group at work to give me company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJlODNkLAMy36H14vudnww.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GSpJ2s8ALN8eLlUoVdWecg.jpeg" /></figure><p>Special Thank you 🙏 to SIGA for conducting Garba and Dandiya workshops every year totally free of cost (yes, you read that right!).</p><h3>Conducted Garba and Dandiya Workshops at office</h3><p>Conducted Garba and Dandiya workshops SRIB (Samsung R&amp;D Institute Bangalore)</p><h4>Day 1: Garba Workshop</h4><p>It was Navratri Season, and a fitting way to start off the week was with a Garba workshop. Suitable for absolute beginners, the session started with absolute basics. Aimed at getting everyone ready to attend and participate at any authentic Garba night event, popular Garba steps were demonstrated :</p><p>Ek Taali (1 Taali), Be Taali (2 Taali), Dodhiyo (along with minor extensions), Tran Taali (3 Taali), and Heench.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*JjmjQT5tJgvpNNpU85KauA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttrOAWSXSskJW7O-h7laJA.jpeg" /></figure><p>Attendees responded well to the sequences and pretty much got Garba flow. Gladly, there weren’t many complaints regarding the choice of authentic Gujarati songs.</p><h4>Day 2: Dandiya Workshop</h4><p>The second day’s session was a natural follow up to the first — Dandiya Workshop. Also suitable for beginners, the session focused on getting people accustomed to the ‘5 Step Dandiya’ popular across the globe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsjJrUaE-mNtFqbidNEtXw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMaAdMlEwXDuvN_cxj8cWA.jpeg" /></figure><p>Grabbing people’s attention after handing over Dandiya sticks was a challenge (😂). However, once everyone got the basic sequence and timing right, it was a sight to behold.</p><p>2 Concentric Circles to ensure changing partners : ☑️<br>5 Step Dandiya :️ ☑️<br>Traditional Gujarati Songs : ☑️<br>Pleasing sound of dandiya sticks that you get to hear when its all in sync : ☑️</p><p>Not so surprisingly, people were hungry for more. A simple variation of a 2 person Garba sequence (albeit with Dandiya sticks) was demonstrated. Fascinatingly, people responded to the sequence pretty well. The sounds of Dandiya sticks when everything is in sync can’t be merely described in words — you must be there to feel it !</p><h3>Attended Garba/Dandiya nights at MLR, Whitefield</h3><p>For two nights in a row, along with friends from the dance group, I attended Garba/Dandiya events at MLR Convention Centre, Whitefield organized by SIGA (Shri Indiranagar Gujarati Association).</p><p>Live Music : ☑️<br>Traditional Navratri tracks : ☑️<br>Decked up in traditional attire : ☑️<br>Garba/Dandiya : ☑️<br>Great company : ☑️</p><p>Fortunately, I could leverage all the dancing that we have done throughout the year as a dance group, and convince people to accompany me to the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alLsIRpvlBNZwNTpahrg5w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJt-d1qFh1K11iJ5zjzcDg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDw9b48ij9jZMvPkWWcyBw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCsPo7aVSxSDeOjMA8w4Hg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4DzGfU8MFvkxbfr6IsA9A.jpeg" /></figure><p>They could get a glimpse of why exactly I enjoy Garba/Dandiya, and how one can almost get into some sort of trance state while performing set sequences in large circles.</p><p>(As a bonus, we snuck into the MLR auditorium — where we had performed for Limelite in 2016 and 2019 — and recreated our entire sequence; in the dark! And we got chased out for doing so. Something fun and illegal for me to narrate to my grandchildren 🤣)</p><h3>Attended Navratri Celebrations at Office Cafetaria</h3><p>Engagements Team conducted a Navratri celebration event at work. Harsha (whom we worked with, for earlier events like Family Day) was the MC and DJ for the evening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qD4CdmOKbfd9uxV3B1_rg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v4fqGy3WHJeIHAcJirb-ew.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXrE0hBwucJp6IgQIEOAPg.jpeg" /></figure><p>Astoundingly (or not, depending on which end of the spectrum you belong to), there were people who demanded Punjabi and Bollywood tracks to be played, and (worse!) refused to dance if traditional Gujarati tracks (best suited for a Navratri event) were played. I leave it to the imagination of the reader as to what would happen if the reverse had happened! Unfortunately, given the limitations of the corporate setup, the MC had to cater to their needs.</p><p>Fortunately, there were people on the other end of the spectrum who were craving for Garba songs to be played, and wanted to implement the learning from the workshops conducted earlier in the week. (Some left midway through the event since the Navratri songs were only being played intermittently)</p><h3>Conducted Garba/Dandiya Workshop at SSIR</h3><p>Jaggu (Gurudev) called, we went.</p><p>Jaggu wanted us to conduct a Garba/Dandiya workshop at SSIR (Samsung Semi Conductor India R&amp;D Center) for Rockz (official Dance Group at SSIR) during Navratri week, and Shilpa and I went. He went all out in generating hype for the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0x8SMwZF2PRzr-P1At9bw.jpeg" /></figure><p>Major shout out to Shilpa 🙏 for agreeing to collaborate in conducting the workshop. It would have turned out very different had I been the only one to teach.</p><p>Ever since the intended workshop at SRIB cafetaria flopped in 2018, I had aspirations of conducting a Garba/Dandiya workshop at a massive scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBFXmrY4F6DNXiHHUzc1fA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2B5XvS9d0FaVuN_kLi8xg.jpeg" /></figure><p>Turns out, Jaggu made it all happen by giving us the space (literally and figuratively) and freedom at SSIR campus cafetaria. We had the good fortune of conducting our biggest (by far) ever workshop (not that I have personally conducted many, but still!).</p><p>Thank you Jaggu 🙏 for having more faith in me than I do.</p><h3>Garba Night at Vasai (Mumbai)</h3><p>I flew to Mumbai to celebrate Navratri with my parents and it was totally worth it. I realized something rather recently :</p><blockquote>My love for dance is not acquired, its inherited.</blockquote><p>My parents are both super passionate about dancing and are extremely talented especially at Garba and Dandiya, and I inherited the former attribute. My mom has trained till Arangetram level in Bharatnatyam in her teenage years (something she told me in 2019!)</p><p>It started with a relatively small gathering at a housing complex in Vasai which my sister Aarti (or Tabu, as we fondly call her) had organized.</p><p>We decided to scale things up a bit. We attended a larger Garba/Dandiya event organized at a nearby park at it was a sight to behold. The kick that I got while seeing the energy levels was amazing!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*cFbRwC64z76VqvDSaJXXHQ.gif" /></figure><p>Only drawback of such events is that there is not much space to freely dance. I realized (yet again) that I’m not very fond of large crowds especially when there is no space left to dance freely.</p><p>Concluding notes:</p><ul><li>I missed my (former) roomie— Harsh the most in the Navratri week (<em>ek number no kutro che, haha</em>).</li><li>I hope I can learn (and hopefully teach) this beautiful dance form at an advanced level in the coming years.</li><li>I hope I gather enough enthusiasm to wear the traditional Garba attire (Kediyu) next season.</li></ul><p>For the Love of Garba ❤,<br>Darshan</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87a88e7747a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dreamz Dance Group (Samsung)  — 2019 Review (so far)]]></title>
            <link>https://medium.com/@darshan_shah/dreamz-dance-group-samsung-2019-review-so-far-409c7f3cb17f?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/409c7f3cb17f</guid>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[livelovedance]]></category>
            <category><![CDATA[dreamz-group]]></category>
            <category><![CDATA[dance]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Fri, 13 Sep 2019 19:53:05 GMT</pubDate>
            <atom:updated>2020-07-28T09:52:01.664Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dreamz Dance Group (Samsung) — 2019 Review</h3><p><strong><em>Dreamz</em></strong> is the official dance group at Samsung R&amp;D Institute Bangalore (SRIB). This article is a compilation of all the crazy things we have done as a group in 2019. There’s too much to read and see, so please feel free to go through it multiple times, covering it in parts if necessary.</p><h4>The madness in numbers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pPBIB_GY4U5ByQ-PQM2nw.png" /></figure><h3>Annual Day</h3><p>The biggest cultural event (by far) at SRIB provided an amazing platform. It gave us a chance to get as many people on stage (43 to be precise; some for the first time in their lives) and in the process, we discovered some extremely talented and enthusiastic people who went on to become prominent faces in the group.</p><p>The overall experience for us was surreal for two reasons — how big the stage was, (figuratively and literally) and that we had barely 10 days to pull off 4 group performances without much pre-existing coordination and chemistry between the people.</p><p>Special Thanks to Manish and Sam for managing the choreography, costumes, and the overall performance in a relatively short span of time!</p><h3>Limelite 2019 (Inter Corporate Dance Competition)</h3><p>Dreamz Group participated in the 2019 edition of Limelite, an Inter-Corporate dance competition organized by Chasse Dance Studio. We put up a performance that we, as performers, are proud of. Energy level, expressions, coordination, and costumes were all pretty much on point. It was a showcase of our diverse competencies in various dance forms (Contemporary, Hip Hop, Bollywood and South Regional).</p><p>To see growth in each of our performers and the group as a whole through the course of this journey was truly satisfying. The standout for us was the emergence of our ‘pocket-sized powerhouse’ Shama who held her own while leading in parts of the sequence.</p><h3><strong><em>Workshop Series Round 1</em></strong></h3><p>Style : <strong>Bolly-Bhangra</strong><br>Song : Wakhra Swag<br>Instructor(s) : Shubham Pandey</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmVcKhhnGcr0SGYqu0X3Dw.jpeg" /></figure><p>Dreamz conducted its first ever Bhangra workshop at SRIB. It received the best turnout ever. There was a time when people had to drop out since there was hardly any space left in the room. The choreography mixed elements of swag and intensity amazingly well (Bolly-Bhangra), as reflected suitably by the response we received.</p><p>Style : <strong>Bhangra<br></strong>Song : Panj Taara<br>Instructor(s) : Harman Jit Singh and Anju Bala</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H72WrdHsvgkroRK9SwKNTw.jpeg" /></figure><p>This workshop conducted by Harman and Anju (from the Bhangra team that performs every year at SRIB Annual Day) was an apt demonstration of authentic Bhangra movements. There was enough learning packed into one session.</p><p>Style : <strong>Contemporary</strong><br>Song : Kaathalae Kaathalae (96)<br>Instructor(s) : Karthik Shetty and Shilpa S Kavasseri</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_2H_0Z5Fprrd0ATUP6F2Lg.jpeg" /></figure><p>On popular demand within the group, a Contemporary workshop was conducted. Attendees got a taste of contemporary movements which require fluidity coupled with a sharp sense of timing.</p><p>Style : <strong>Bollywood</strong><br>Song : First Class (Kalank)<br>Instructor(s) : Shubham Pandey and Karthik Shetty</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sN7nGUv0d0MqADF0NAf9Kg.jpeg" /></figure><p>This was easily the most fun choreography of the year with a varied range of movements in true Bollywood style. It was suitable for all levels of dancers — beginners were able to learn the steps and enjoy the music while experienced campaigners could appreciate the finer intricacies.</p><p>Choreography inspiration : Melvin Lewis and Sonali Bhadauria.</p><p>Style : <strong>Hip Hop</strong><br>Song : Uptown Funk (Mark Ronson ft. Bruno Mars)<br>Instructor(s) : Mohit Bajaj</p><p>This was another choreography suitable for all levels of dancers. The groovy movements complemented the track. Importantly, it provided enough learning for one workshop, with multiple Hip Hop styles jumbled into one — Top Rock, Locking, Popping, Nae Nae, etc.</p><p>Style : <strong>South Regional</strong><br>Song : Heartukulla (Gulaebaghavali)<br>Instructor(s) : Vivekanandan S.</p><p>This choreography by Vivek suited beginners in South Regional styles pretty well. Song selection was on point as the tempo was moderately fast. As a result, dancers could enjoy the movements without bothering about missing the beats. The core attributes of South Regional folk, however, were well preserved.</p><p>Style : <strong>South Regional</strong><br>Song : Ranga Ranga Rangasthalana (Rangasthalam)<br>Instructor(s) : Periasamy and J. Sushmitha.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OHnSksRibLcBMxqTJWp6Sg.jpeg" /></figure><p>With this choreography, the tempo and difficulty level was cranked up a notch. It was a demonstration of how unambiguously awesome it feels like to perform (or even just watch) massy South Regional folk dance! Peri and Sushmitha were exceptional with the workshop proceedings — as it was at least an intermediate level choreography.</p><p>Style : <strong>Semi-Classical</strong><br>Song : Ghar More Pardesiya (Kalank; Shreya Ghoshal)<br>Instructor(s) : Shilpa S Kavasseri</p><p>Dreamz conducted its first ever Semi Classical workshop. Surprisingly, a decent number of enthusiastic people showed up — including boys (something we hadn’t expected to witness). ‘One woman army’ Shilpa was outstanding with the choreography (which fit perfectly with the<br>track) as well as the workshop. Most people were trying out semi classical for the first time, but were able to manage decently well.<br>(NB : Thank you Shreya Ghoshal for gifting us such a classic track)</p><h3>World Dance Day (April 29th)</h3><p>World Dance Day celebrations event was one of the highlights of the year. We had an aim to make it the biggest celebration of dance and we pretty much achieved it.</p><p>We received our Dreamz branded tshirts just in time for the event. (Thank you, AllThingsCustomized for the prompt follow ups and timely deliveries)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xkVYrZQyv6liMUsvLfdh0g.jpeg" /><figcaption>Dreamz Group @ Tranquility Bay, Samsung R&amp;D Insititute Bangalore Campus</figcaption></figure><p>It started with a series of faceoffs to showcase choreographies that we had covered during the workshops (8 to be precise) that preceded the event. A lot of first timers got a chance to perform on the floor, away from the nerves that accompany a stage performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Wm3xIiaGHw47sUHfIjFYg.jpeg" /><figcaption>Happy faces after the event :)</figcaption></figure><p>A sequence of ~15 short but crisp solo, duet, and trio performances from members of the Dreamz Group followed.</p><p>To conclude the event, the floor was opened for everyone to dance their hearts out to ensure a fitting end to the World Dance Day celebrations.</p><p>(Special thanks to <strong>Rushikesh</strong> from Engagement Team for supporting the event on very short notice and suggesting that we make first use of the Tranquility Bay space at Pheonix Building)</p><h3>Celebration Event for 25 Years of our M.D. at Samsung</h3><p>Our performance at the event celebrating our M.D. Mr. Dipesh Shah’s completion of 25 years at Samsung was again, pretty satisfying for two reasons. Firstly, we barely had about a week and a half to prepare. Secondly, we were able to put up a thoroughly professional performance covering multiple dance forms (Bollywood, South Regional and Bhangra). We were slightly disappointed though, since we didn’t receive much energy to feed off from the audience.</p><h3>Interns’ Day 2019</h3><p>Interns’ Day holds a significant place for some of us, since it is where our journeys started with Dreamz. Barely a week’s practice was sufficient, since we could leverage the comfort level and confidence that we had gained throughout the year. Expectedly, the interns were an extremely encouraging audience.</p><h3>Dreamz Group @ Cubbon Park</h3><p>This was an especially important milestone for us as it was our first outdoor shoot. We spent our Sunday morning at (arguably) the most beautiful location in Bengaluru — Cubbon Park and it was extraordinary.</p><p><a href="https://www.instagram.com/seekvoyage/">Raj Shekar</a>, a friend from <strong><em>Bengaluru Skaters</em></strong> (a skating community that meets on a weekly basis at Cubbon Park on Sundays), was kind enough to shoot and edit some of our dance videos.</p><p>We had a super supportive audience with skaters and random passers by. Performing at Cubbon Park was a different kind of experience — one we enjoyed thoroughly!</p><h3>Workshop Series Round 2</h3><p>Style : <strong>South Regional</strong><br>Song : Adchithooku <br>Instructor(s) : Jagadeesh Usurupathi and J. Sushmitha</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDhHQC6NQjwlwbHCmk3A7g.jpeg" /></figure><p>We resumed workshops starting with South Regional on the song Adchithooku featuring Tamil superstar Ajith Kumar. It was a celebration for us, since it marked Jaggu’s (our Guru, inspiration, karta-dharta) comeback after a major injury. ‘Mass Rani’ Sushmitha, in her last event with Dreamz, gave him great support and conducted the major chunk of the workshop. The sequence was well received by the attendees for the high energy and massy regional steps!</p><p>Style : <strong>Bhangra<br></strong>Song : Jehri Kudi<br>Instructor(s) : Shubham Pandey</p><p>‘Life of all parties’ Shubham conducted his last dance workshop at SRI-B and opted for his favourite dance form. We witnessed a pretty decent turnout with palpable energy in the room.</p><p>The attendees were able to manage a relatively intermediate choreography pretty well and got the Bhangra feel right on the money!</p><p>(choreography inspiration : Bfunk)</p><p>Style: <strong>Semi-Classical</strong><br>Song : Mitwa<br>Instructor(s) : Shilpa S Kavasseri</p><p>Among the most beautiful choreographies on a soulful track, it was a workshop for the ages. Shilpa did a great job teaching it to people, most of whom have little or no background in Semi Classical. The outcome exceeded our expectations as the attendees could articulate the overall tone of the choreography pretty well.</p><p>(choreography inspiration : Vinayak Ghoshal from “Natya Social”)</p><p>Style : <strong>Lavani</strong><br>Song : Hitchki<br>Instructor(s) : Shrutika Girme and Trupti Bargale</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAtX_rzOUh3Gj19VZl6ZaA.jpeg" /></figure><p>We conducted a Lavani style workshop for the first time at SRI-B. Lavani style dance is especially different from other styles. Along with a high dose of energy, there is a special emphasis on expressions which is integral to the style in general.</p><p>The choreography by Shrutika and Trupti ticked all the right boxes and ensured that all attendees had an amazing time learning a new style.</p><h3><strong><em>Independence Day Special</em></strong></h3><p>Style : <strong>Contemporary</strong><br>Song : Teri Mitti (Kesari)<br>Instructor(s) : Preethi Shetty and Karthik Shetty</p><p>This was another one for the ages. Preethi and Karthik prepared this beautiful piece of choreography for our Independence Day celebrations.</p><p>Attending the workshop conducted by Preethi felt like being part of a meditation session which was an interesting change.</p><p>Song selection was on point. We also made (probably) the first use of the newly built space at SRI-B — Eden Point, which provided the perfect backdrop for the sequence, to shoot a video for this performance. It surely will go down as one of our finest video recordings as a group.</p><p>(Special Thanks to <a href="https://www.instagram.com/anindyac07/">Anindya Chakravarti</a> for the videography and editing)</p><p>Style : <strong>Hip Hop<br></strong>Song : Closer by Chainsmokers<br>Instructor(s) : Mohit Bajaj and Karthik Shetty</p><p>This sequence had an overwhelming ‘Urban’ style touch to it with sutble lyrical elements embedded. Urban style differs from other Hip Hop styles in that the focus is less on the movements being loud and more on being cool, groovy, and filled with swag.</p><p>Mohit did a great job at demonstrating the tone of the choreography. Gladly, attendees were able to pick up the feel of a rather challenging set pretty well.</p><p>(choreography inspiration : Kinjaz)</p><p>Style :<strong> Bhangra </strong><br>Songs : Ghaint Patola (Offlicence) and Mauja hi Mauja (Jab We Met)<br>Instructor(s) : Priya Rani and Twishi Tyagi</p><p>Back to back Bhangra workshops were conducted to cap off the second phase. The workshops started with introduction to basic Bhangra movements followed by choreographed sequences. Choreography was basic on the first day, but levelled up on the second in order to build on the basics already established. What was consistent on both days was the essense of Bhangra remaining intact — having a good time and dancing without inhibitions. First time instructors Priya and Twishi did exceedingly well in engaging with a lot of first timers and ensuring that it was a fun session.</p><p>(choreography inspiration : Bfunk and Gaurav Thukral)</p><h3>RHA (Robinhood Army) x Dreamz</h3><p>The members of Dreamz Group (Vivek, Shama, and Darshan) visited a location in Brookefield where Robin Hood Army conducts weekly academy drives to teach slum kids. For about 45 minutes, kids were taught basic dance moves on popular Kannada songs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZ5gjYwQ2Mue5QGqt3RRFQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B32iAWsYOrVpYEQ19y04rg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6AqWqq0xcrgV0eWXU8VVVQ.jpeg" /></figure><p>They had a certain glow in their eyes when they were dancing. Ever so eager to learn, the kids are packed with immense potential and talent. They’re already capable of doing somersaults and all kinds of crazy tricks. Teaching them choreography was an amazing experience — one that we hope we can make a habit of.</p><h3>Family Day</h3><p>Family Day 2019 at SRI-B was a fun filled affair for Dreamz Group. It started with a set of workshops catered to kids as well as adults. Harsha, the M.C. for the event was of great support in managing and engaging with the crowd. Vivek, Shama and Preethi conducted the workshop with such enthusiasm that it left the parents (and kids) also asking for more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D24q8uMqHWDxETwL8vTnMw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGZTYKtuHBDxA2XuLDevcw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMw9h5zyrUc7pk8tJjXv4g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-SB7sVmH3N_RMNpkzaSoGQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYhzbGLxxkod8yn8_NX54g.jpeg" /></figure><p>What followed was a surprise flash mob where the crew performed to ultra popular Bhangra, South Regional and Bollywood tracks. By the time the Bollywood sequences started, it turned into a massive celebration with audience members joining in. Tiger Dance (traditional Mangalorean folk dance) was a fitting end to the sequence since people could dance their heart out.</p><p>On public demand, we performed the same sequence for a second time at the same venue and a third time at a different engagement spot.</p><p>Special thanks to all the in-house choreographers (Twishi, Priya, Karthik, Shilpa, Shama, Peri, Preeti and finally our ‘Gurudev’ Jaggu) for having given all their time and efforts in making the event a huge success.</p><p>Style :<strong> Bhangra </strong><br>Songs : Gal Ban Gayee (Sukhbir)<br>Instructor(s) : Priya Rani and Twishi Tyagi</p><p>This was another amazing Bhangra workshop suitable for all levels of dancers. Priya conducting her final workshop (as a Samsung employee) along with partner-in-crime Twishi were now loaded with confidence. Based on feedback received during earlier workshops, a popular track was chosen. The perfect blend of grooviness and high energy in the track and the choreography resulted in the release of a lot of happy hormones. It was a fitting end to ‘Laughing Buddha’ Priya’s journey at Samsung.</p><p>(choreography inspiration : Gaurav Thukral)</p><h3>Navratri Season Workshops &amp; Event (Garba and Dandiya)</h3><h4>Day 1: Garba Workshop</h4><p>It was Navratri Season, and a fitting way to start off the week was with a Garba workshop. Suitable for absolute beginners, the session started with absolute basics. Aimed at getting everyone ready to attend and participate at any authentic Garba night event, popular Garba steps were demonstrated:</p><p>Ek Taali (1 Taali), Be Taali (2 Taali), Dodhiyo (along with minor extensions), Tran Taali (3 Taali), and Heench.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*JjmjQT5tJgvpNNpU85KauA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttrOAWSXSskJW7O-h7laJA.jpeg" /></figure><p>Attendees responded well to the sequences and pretty much got Garba flow. Gladly, there weren’t many complaints regarding the choice of authentic Gujarati songs.</p><h4>Day 2: Dandiya Workshop</h4><p>The second day’s session was a natural follow up to the first — Dandiya Workshop. Also suitable for beginners, the session focused on getting people accustomed to the ‘5 Step Dandiya’ popular across the globe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsjJrUaE-mNtFqbidNEtXw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMaAdMlEwXDuvN_cxj8cWA.jpeg" /></figure><p>Grabbing people’s attention after handing over Dandiya sticks was a challenge (😂). However, once everyone got the basic sequence and timing right, it was a sight to behold.</p><p>2 Concentric Circles to ensure changing partners : ☑️<br>5 Step Dandiya :️ ☑️<br>Traditional Gujarati Songs : ☑️<br>Pleasing sound of dandiya sticks that you get to hear when its all in sync : ☑️</p><p>Not so surprisingly, people were hungry for more. A simple variation of a 2 person Garba sequence (albeit with Dandiya sticks) was demonstrated. Fascinatingly, people responded to the sequence pretty well. The sounds of Dandiya sticks when everything is in sync can’t be merely described in words — you must be there to feel it !</p><h3>Cubbon Park 2.0 (Bigger and Better)</h3><p>What started of as a simple idea from Vivek — A tribute to Jaggu, eventually turned out to be much bigger than we had initially anticipated.</p><p>We basically owe everything to Jaggu, for providing impetus to the group year after year, for staying strong and energetic even when there wasn’t much of a team, for his unwavering passion for dance and for inspiring us every single day.</p><p>Since we were planning for a tribute to our Gurudev, we just had to involve our friends over at SSIR (Samsung Semiconductor India Research). Therefore, the plan had to involve a neutral venue.</p><p>What better venue than Cubbon Park ❤.</p><p>Since we were going to Cubbon Park, we decided to give maximum opportunities to as many people as possible. What resulted was two newly cooked sequences (Verithanam and Jai Jai Shivshankar), introduction of a few of our old sequences (choreographed post the first Cubbon Park outing), and a slew of solo and duet sequenes.</p><p>Once again, we were ever so lucky and grateful to have Raj Shekhar (the friend from Bengaluru Skaters who runs the “Seek Voyage” channel on Youtube and Instagram) shoot the critical videos for us.</p><p>Despite being chased out for shooting dance videos (actually not allowed at Cubbon Park), we managed to find a couple of secluded spots and managed to execute our entire plan of the day. An immensely satisfying experience for the group as whole and a day well spent dancing (❤) at Cubbon Park (❤)</p><h4>Dance Workshop: Wedding Sangeet Special</h4><p>Style : <strong>Bollywood<br></strong>Song : Morni Banke (Badhaai Ho)<br>Instructor(s) : Twishi Tyagi and Darshan Shah</p><p>As we approached the Indian wedding season, we figured — “Why not have a workshop for people to perform at the Sangeet event of loved ones?”. A rather simple choreography turned out to be super entertaining and engaging.</p><h3>Last Workshop of 2019</h3><p>Style : <strong>South Regional<br></strong>Song : Chumma Kizhi (Darbar)<br>Instructor(s) : Periasamy and Afzal Shama Soudagar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9YhA3qaFKReY0Yt7QmbEw.jpeg" /></figure><p>Superstar Rajinikanth x SPB x Anirudh Ravichander = sure shot formula for a superhit Mass song. (Remember Marana Mass?). Over-excited as we always are, we choreographed this song even before the full video song was released!</p><p>Choreographed by Peri, Shama and Vivek, this sequence was filled with high energy steps that fit the song perfectly. Peri and Shama (taking her first workshop) were brilliant in teaching another intermediate level choreography. Attendees were spot on in getting the feel of the choreography as well as the song.</p><h3>2019 Year End Party at SSIR</h3><p>Jaggu called, we obliged.</p><p>Choreography : Vivek, Peri, Shama, and Preethi.<br>Lot of new faces for the performance!</p><p>Felt great going back on stage after 5 months :)</p><h3>The faces behind the madness</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nq8F7HUqaVC5usDxe-IwYA.png" /></figure><p>It would be remiss of us not to acknowledge contributions of various people at SRI-B — GA Team (Kalpana Ma’am, Bhoja Sir, and the entire super supportive Pheonix Gym staff), Communications Team (Mausam, Sudheesh, and Manikandan) and the Engagement Team.</p><p>To all those who have been part of our journey in at any stage this year, we would like to extend our sincere gratitude. All the love we’ve received has been a massive source of encouragement that has kept us going at all times.</p><p>For the Love of Dance,<br>Dreamz Group<br>Samsung R&amp;D Institute, Bangalore</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=409c7f3cb17f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Probably the most underrated leadership attribute]]></title>
            <link>https://medium.com/@darshan_shah/one-of-the-most-underrated-leadership-attribute-6085820868a9?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/6085820868a9</guid>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Wed, 04 Sep 2019 18:47:09 GMT</pubDate>
            <atom:updated>2019-09-07T18:05:34.460Z</atom:updated>
            <content:encoded><![CDATA[<p>We’re all leaders at some point in our lives. Like when we employ people (house help, perhaps!) or when we speak to juniors at school or work, or when we speak to children, or when we’re teachers (everyone should always be one, in my opinion). If not leading others, we’re at the very least, beings that lead ourselves everyday. It is important to treat oneself with care.</p><p>And with leadership comes responsibility. Of their well being. Of caring deeply about them. Of being aware of their development needs. Of making conscious efforts to ensure their learning and growth. Of leading by example.</p><p>All that said and done, one thing that is equally essential is to create a sense of calm. Its something I have learnt the hard way, and to be really honest, am still yet to consistently achieve.</p><p>I have made multiple mistakes in this regard over the years. Like when I addressed a bunch of super nervous juniors of what they needed to do land their dream internship (and scared them with too much advice). Or when I tried to scare a friend who was new to class in an attempt to push him to work harder. Or when I was revising a choreography set with a bunch of first timers who freaked out on the first day itself because I tried correcting too many things. Or when I freaked out a friend before an important exam. Or when I taught high school kids and expected them to share the same passion for the subject. Or when generally speaking to friends about random things and emphasizing on negative possibities.</p><blockquote>In short, its not that hard to create a sense of panic - especially when in a position of responsibility. What’s hard is ensuring a sense of calm at all times even when the situation is challenging.</blockquote><p>When I&#39;m dancing, for example, I have an urge at all times to make sure that I look closely at my own self (through videos or even through the mirror) and make a sincere attempt to fix rough edges and constantly improve. I tend to have similar expectations from others in the room too, which is not always fair. A lot of people turn up to have fun and not bother much about the technical aspects and that is perfectly fine in the existing context.</p><p>Its okay to, once in a while, to ignore a few mistakes (even glaring ones). If there is any inclination to learning, things automatically improve over time.</p><blockquote>Correcting things at every step of the way is a progress hindering practice.</blockquote><p>A prime example of an excellent leader is the former captain of the Indian national cricket team, M. S. Dhoni. What stood out for me was how he inspired his team mates. He was always aware of the fact that players in the team had enough talent to be selected in the first place. He, therefore, on most occassions, kept his words of advice to a bare minimum - only to boost confidence. Not to indicate that this is the silver bullet for leadership, but it is an important lesson.</p><p>At the end of the day, we&#39;re all students (even when we&#39;re leaders or teachers). We should, in that case, always be learners. Learning by experiences of beings around us (including ourselves) can help us improve in ways we can&#39;t even foresee.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6085820868a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My first introduction to *serious* dancing]]></title>
            <link>https://medium.com/@darshan_shah/my-first-introduction-to-serious-dancing-ef43975a1306?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef43975a1306</guid>
            <category><![CDATA[martha-graham]]></category>
            <category><![CDATA[yoga]]></category>
            <category><![CDATA[contemporary-dance]]></category>
            <category><![CDATA[william-forsythe]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 18:43:05 GMT</pubDate>
            <atom:updated>2019-08-18T18:51:50.947Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been quite the week!</p><p>It all started a few days back, when I had this desire to learn dance more seriously. I discovered <strong>Attakalari</strong> which has a long standing reputation of being one of the finest dance academies not just in Bangalore, but in India. At Attakalari, the faculty as well as the students take dance very seriously. I saw the brochure for the ‘<em>August with Masters</em>’ program and I found a lot of interesting classes. I tried to figure out an itinerary for myself to be able to cover maximum number of classes.</p><p>The first class I decided to attend was on ‘<strong>Improvisation</strong>’ by <em>Ion Garnika</em>, who has himself been part of the William Forsythe company when they came up with their take on Improvisation techniques and principles. It was pretty enlightening to find some boundaries and structure when one could easily assume it to be completely unstructured.</p><p>Among the things that stayed with me after the class were:</p><p>Improvisation in Dance could be classified into three parts : Body, Space and Time.</p><p>1. Body — there are different joints in the body and different degrees of freedom on movement for each. It is important to recognize these possibilites in isolation for each joint.<br>2. Space — there are 3 degrees in space : Low, Medium and High. High generally means being on the toes or even in the air. Medium means at the level one normally stands. Low means going down by bending the knees or even all the way down on the floor.<br>3. Time — A certain sequence of movements can attain completely different meaning and structure by simply changing the dynamics within the entire spectrum of slowing things all the way down and pacing things all the way up.</p><p>Basics of William Forsythe improvisation techniques start with the simple idea that you are at the centre of a cube. There are 6 faces of the cube (forward, back, up, down, left, and right), 3 layers (floor, ceiling, and central plane cutting across the body) and 9 x 3 = 27 points.</p><p>The first exercise started with picking any 2 of the 27 points, and one joint, and trying to build a sequence by connecting the 2 points using the chosen joint only (its okay to have residual movements of other parts of the body but nothing beyond that) by drawing a straight line, curve or circle. between the two points.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F2912642%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F2912642&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F86860730_200x150.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="248" height="248" frameborder="0" scrolling="no"><a href="https://medium.com/media/3084913b99e565570c7aacbd75e544de/href">https://medium.com/media/3084913b99e565570c7aacbd75e544de/href</a></iframe><p>An important thing to note here is that generally movements that involve orienting the <strong><em>ends of our extremities</em></strong> towards these points (hands, toes, etc.). Very seldom do we consider orienting <strong><em>inner joints</em></strong> (eg: knees, or elbows) to these points. Doing so provides us with a different relationship to the same model that we are used to with dance forms like Ballet, or Contemporary.</p><p>Furthermore, Improvisation on top of the created sequence can involve exploring change in space (levels) or time (slowing down or speeding things up)</p><p>The cube can also be rotated in multiple ways in all the axes (4 sides/facing the floor/facing the ceiling). Inclination is also a possible area to explore.</p><p>Side note : with a translation in the 3d space, the cube which encapsulates the dancer also translates.</p><p>It was an amazing experience since there was enough learning, challenges and yet an open space to improvise. However, I was clearly not ready to extract most out of the class because of my limited vocabulary in dance forms that involve extensive work on technique like Contemporary or Classical Indian forms.</p><p>The next set of classes I chose to attend were ‘<strong>Contemporary</strong>’ by <em>Vishal Telang</em>. The first thing that struck me about him was how passionate he is about the art by how seriously he took his class even though there were only two students. He had structured his classes pretty well. It starts with basic exercises designed to get the body ready for all the hard work that will follow but keeping in mind the kind of movements that the Contemporary dance form will require.</p><p>From Wikipedia article on Contemporary Dance :</p><blockquote>In terms of the focus of its technique, contemporary dance tends to combine the strong but controlled legwork of ballet with modern that stresses on torso. It also employs contract-release, <a href="https://en.wikipedia.org/wiki/Floor_work">floor work</a>, fall and recovery, and improvisation characteristics of modern dance.</blockquote><p>The class started with a basic introduction to positions of the feet in ballet (just the first four), which may seem easy from the outside, but takes time and practice to truly perfect.</p><p>The entire session was loaded with a lot of technical ballet terms, mostly in French, which obviously was hard to recollect (<a href="https://en.wikipedia.org/wiki/Chass%C3%A9">Chassé,</a> Passé, <a href="https://en.wikipedia.org/wiki/Pirouette">Pirouette,</a> Plié, Relevé, Rond de jambe, Tendu, etc.), but interesting to learn since the dance forms that I have learnt (mostly informally) don’t put much emphasis on technique or terminology.</p><p>The style of dance is a mix of some of the basic Ballet principles and Martha Graham technique.</p><p>From the Wikipedia page on Martha Graham technique:</p><blockquote>Graham dancers are trained to highlight their effort and use weight as a dramatic tool, while ballet dancers strive to appear weightless and effortless.Graham technique’s use of large torso movements and floorwork represent further breaks from the balletic tradition.</blockquote><p>Any positions and movements require the body to always be in proper alignment . For example, the hips should remain square and not fall apart to create the “spiraling” of the torso around the axis of the spine. Another important aspect of the Martha Graham technique discussed was “Contraction and Release”.</p><blockquote>According to Martha Graham’s philosophy, movement is generated from three places: the action of contraction and release, the pelvis, and the emotional inner self. The contraction, or strong pulling back and curving of the torso, and the release of this movement by returning to a straight torso are symbolic of the dichotomies in life. It is the contrast between desire and duty, between fear and courage, between weakness and strength.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fuf82AliwwYk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Duf82AliwwYk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fuf82AliwwYk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f88df67991a1c88eafe0871eec1cdf3/href">https://medium.com/media/7f88df67991a1c88eafe0871eec1cdf3/href</a></iframe><p>It is followed by a short workout exercise designed to stretch and strengthen the muscles to get the body moving better and feel more flexible. He then moves on to the actual sequence, which I must admit, is challenging for someone without any formal training in Contemporary, Ballet, or other forms with somewhat similar movement patterns. All the warmup exercise and workout sessions play an important role in how the body will flow for the actual routine.</p><p>I was struck by a realization (an obvious one, actually) that I need to work much more on myself with regards to posture, flexibility, strength, stamina - basically everything. And looking at how simply the other student was being able to respond to the instructions augmented those thoughts. (Although it was to be expected as she had 15 years of training in Ballet).</p><p><a href="https://photos.app.goo.gl/EhcNL7Lav82qRoHC8">New video by Darshan Shah</a></p><p>I’ve been wanting to take proper training in Contemporary for quite some time now, and this was a small step in that direction. All I need to do now, is figure out how to adjust my schedule and attend classes more regularly.</p><p>The last class that I attended was ‘<strong>Lyrical Yoga</strong>’ by <em>Deepti Martolia</em>. I’m glad I attended the class for various reasons.</p><p>Firstly, it was a brutal reminder of how poor my posture is, and how regular Yoga practice can help me correct it (like it has, this year — my dance performances in 2019 look much better than previous years because I have corrected my hunch back slightly and I am not looking at the floor while dancing which is indicative of a slightly improved alignment).</p><p>Secondly, it rekindled my love for Yoga as a long term option to keep the mind and the body in a positive state. This was the first live yoga class I have ever attended and it was totally worth it. Soft music in the background, focus on conscious breathing, and slow but extremely challenging sequences.</p><p>Thirdly, the instructor was kind enough to correct me on multiple occasions about the asanas I was performing. To benefit most from the poses, it is important to breathe and have correct technique. I have been practicing a lot of basic and fundamental Yoga poses (Warrior poses, Upward facing Dog, Downward facing Dog, standing splits, etc.) by following Sarah Beth’s channel on Youtube (highly recommended if you’re into Yoga, or if you want to try it out) albeit with slightly incorrect technique (since I haven’t had anyone to correct me). While I was performing standing splits, I had weight on my palms, whereas the entire weight should be on the landing foot and the palms are there just to maintain the balance if required. For other asanas, where the upper body bends over, it is imperative that the spine stays straight and the body hinges at the hips and not at the lower back. The warrior poses, which may seem pretty easy, actually aren’t. The body needs to be in one plane, feet firmly grounded, knee stays strong and with a tall spine.</p><p>Other students in the class were able to manage with relative ease, and I felt miserable when looking at myself in the mirror unable to do some of the asanas due to a rounded spine. The class was a further nudge to intensify my Yoga practice sessions if I am to improve on my posture, flexibility, alignment, and strength.</p><p>To conclude, (not sure if you’re still here, but anyway) I am glad that I attended these workshops, and that I was consistently the weakest student in all of these classes. It reminded me of how much I need to improve on my fitness, posture, and flexibility (not the first time in this blog that I have used these terms in conjunction). I realized how amazing it would be to get formally trained by attending regular classes.</p><p>For the Love of Dance, (and Yoga)<br>Darshan.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef43975a1306" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2018: Year Rewind]]></title>
            <link>https://medium.com/@darshan_shah/2018-year-rewind-ff703bdcbad2?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff703bdcbad2</guid>
            <category><![CDATA[dance]]></category>
            <category><![CDATA[skating]]></category>
            <category><![CDATA[ice-skating]]></category>
            <category><![CDATA[piano]]></category>
            <category><![CDATA[travel]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Sun, 30 Dec 2018 18:47:55 GMT</pubDate>
            <atom:updated>2019-05-15T15:35:43.389Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>January:</em></strong></p><ul><li>Visited Uvassagaram Tirth, and Kevalya Dham Tirth (Raipur)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V9bdE0zGUhMtd96oHjzfDA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9wbUMSdS_ubvw-aw3Oa5g.jpeg" /></figure><ul><li>Annual Day Dance practice in full swing. (Made some awesome friends; Tried contemporary for the first time)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Egyo5G5fWondrrWYdy__5g.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*cYlAqXzLV2Xet0lmA3RGZA.gif" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOYzg-iongAk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOYzg-iongAk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOYzg-iongAk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cf252d279b89947c4cb65c73b046a80/href">https://medium.com/media/8cf252d279b89947c4cb65c73b046a80/href</a></iframe><p><strong><em>February:</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGj4LxXd2xBM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGj4LxXd2xBM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGj4LxXd2xBM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e923a92f409e5957c5c488e0438264ef/href">https://medium.com/media/e923a92f409e5957c5c488e0438264ef/href</a></iframe><ul><li>Annual Day @ 16th Feb 2018. ❤ (Was Lead for some portions in 2 sequences)</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FzJ12nQCRNyA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzJ12nQCRNyA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzJ12nQCRNyA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7703130bd661c7dbfc9be113c369401/href">https://medium.com/media/f7703130bd661c7dbfc9be113c369401/href</a></iframe><ul><li>Visited Padmavati Temple in Krishnagiri and Sushil Dham with Rajesh Kaka</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVP1mNIuoxRF6_KIfvkRVA.jpeg" /></figure><p><strong><em>March:</em></strong></p><ul><li>Attended Urban choreography workshop</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlIcmvsgIbV0%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlIcmvsgIbV0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlIcmvsgIbV0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e8cb89015cf7ba0346c4db276d51d12/href">https://medium.com/media/4e8cb89015cf7ba0346c4db276d51d12/href</a></iframe><ul><li>Visited Wayanad, Mysore, and Ooty</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zm-cJSUxfMa5CS3ZDeJiYw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*CqZ3bhUHAM7LV0A6oRKgYA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h69AY933wQlSoin7s-vs-Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQ5vsxR3mic0HCXKePXRHA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*bczk5xWHAaPrN73t7NZvPA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omZBPBtHcLFGRqgYEIzqZA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydaH3h4cigQz2hMkFDamyQ.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyBCHrrjVvEg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyBCHrrjVvEg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyBCHrrjVvEg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d124dee844d7a2815a20f91a959fff57/href">https://medium.com/media/d124dee844d7a2815a20f91a959fff57/href</a></iframe><p><strong><em>April:</em></strong></p><ul><li>Visited Samsung HQ @ South Korea</li><li>Skated in Korea (Gwang-gyo Lake Park ❤)</li><li>Ice Skating at Lotte World ❤</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PLTw2RRxl8uX3LpxM-Dfpw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UR-gxpXmg1MlEVf38yx2BA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXZcjfTN_NgXT--oEB3Hhw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-Tx6snrzQOlLOpsCU6RAQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xy4Q_6P4y1bLyAFHLiyoXg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YvD0jrREsZKXLf61CbVxNw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcjHV6T0Ozydwilo8JLpHg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XI9k30nAvhAYE_hlBDHJ6A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJoANjJAWlQXl_vKVp-suA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3uQwdOcBcw5a14LteCD6A.jpeg" /></figure><p><strong><em>May:</em></strong></p><ul><li>Started learning piano with Punit</li></ul><p>https://facebook.com/bangaloremusicinstitute/</p><ul><li>Visited Shravanbelgola Temple</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6OdLtZZUhwqrfheBcScBTg.jpeg" /></figure><p><strong><em>June:</em></strong></p><ul><li>Purchased LED Wheels for my inlines (LOL !)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6TwgdQamTHw0J36D1JofTw.jpeg" /></figure><p><strong><em>July:</em></strong></p><ul><li>Notebook donation drive (Samsung CSR Activity)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEF0MJsstSvqgMwk6_zAEg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R1hh-rpR_vf1rBbHV1ktkw.jpeg" /></figure><ul><li>Started playing Squash with Punit. Amazing sport!</li></ul><p><strong><em>August:</em></strong></p><ul><li>Visited Mumbai for taking technical interviews at VJTI for internship @ Samsung</li><li>Started reading ‘The Power of Habit’ as an audiobook. (A must read!)</li></ul><p><strong><em>September:</em></strong></p><ul><li>Got recognized at work : received Samsung Citizen Award for being a ‘Highflier’ ❤</li></ul><p><strong><em>October:</em></strong></p><ul><li>Learnt Garba, FINALLY!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpK-TNyC5E5P6ov48sfQOg.jpeg" /><figcaption>with Kunal Bhai (Guruji!) Insta @ <a href="https://www.instagram.com/kunall.patel/">kunall.patel</a></figcaption></figure><ul><li>Conducted Garba event at Samsung</li><li>Visited Coorg for 3 nights, 4 Days with Family @ Club Mahindra (What Food! ❤)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEP69bWL-ai7IsiDLGuT9Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4b697B04UsPOcj6tGuCUdw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtNtjTLOR4LgZJ51YYs2YA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xk6zrMcXfMyLtetKtxmabw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UMmdZQ9vUAUQl-plCz423g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*77S1clep6JUyPTqWVtqfcw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_liZPna12mzkdCvvKeo3YA.jpeg" /></figure><ul><li>Learnt Cycling (I know! Strange, and a bit embarassing)</li><li>Learnt ‘River Flows in You’ by Korean pianist Yiruma.</li></ul><p><strong><em>November:</em></strong></p><ul><li>Started prep for Trinity Grade 2 Piano Exam.</li></ul><p><strong><em>December:</em></strong></p><ul><li>Dance @ SSIR Annual Day ❤</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00rD2COMFHoa7ihThhFT6Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-FHKO-gOzPlZZyJGAmSQg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LJssqktTngF0OWrhO7H9g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uBQhvPVBfsPsY4pE8RtQ5w.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FkWCrn8-Cwr8%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkWCrn8-Cwr8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FkWCrn8-Cwr8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ec70c3682c3335b7d056475cd0508e7/href">https://medium.com/media/0ec70c3682c3335b7d056475cd0508e7/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fuzoho4V9cEQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Duzoho4V9cEQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fuzoho4V9cEQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8daf21128e8e13f2fafcad6ad660dcf/href">https://medium.com/media/f8daf21128e8e13f2fafcad6ad660dcf/href</a></iframe><ul><li>Conducted 2 Dance Workshops at Samsung (50+ and 40+ turnout)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zxCfvVDfWtX6yJGS6KZX1g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIppGJs0Upl8yBDOQqMiKA.jpeg" /></figure><ul><li>Visited Palitana, Surat, Vadodra, and Ahmedabad with Paa.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xvIw8cR7u0H0imLASzv03Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4i-iBvjNL5Q8kRXLQZ2_Kg.jpeg" /></figure><ul><li>Skated @ Sabarmati Riverfront, Ahmedabad on 24th and 25th December</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PHEFjOhd4kgQUy55xLISlA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_FABjmJsgn1bkQ8cNG3cUw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uHxBt6Fb47OJRHnVpUNf8g.jpeg" /></figure><p>2018 has been a fantastic year.</p><p>What went well, was awesome! Did things not even on my bucket list.<br>What didn’t go well, was incredibly useful learning!</p><p>Hope that 2019 will be even better!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff703bdcbad2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5. Pointers and Arrays : Match Made in Heaven]]></title>
            <link>https://medium.com/sillyquestions/5-pointers-and-arrays-match-made-in-heaven-68fff2d2b3d1?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/68fff2d2b3d1</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[pointers]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Sat, 03 Jun 2017 10:09:24 GMT</pubDate>
            <atom:updated>2017-06-03T10:09:24.741Z</atom:updated>
            <content:encoded><![CDATA[<p>Pointers and Arrays are indeed a match made in heaven. You will soon know why ! But first, lets take a closer look at Arrays;</p><p><strong><em>Array</em></strong>: An array is a set of variables of the same data type, stored in contiguous order and accessed by a single variable name.</p><p>int x[100]; This is a simple array declaration. Looking at the above definition, we can see what x is all about — x is a set of 100int variables stored in contiguous order and accessed by a single variable name, which is, well, x. Most things are obvious, apart from the <strong><em>contiguously stored </em></strong>part.</p><p>Contiguously stored means ‘stored one after the other’, which again, may seem obvious but has far reaching consequences, which become slightly more clear as you read on.</p><p>So now we know that the 100 variables together known as x are stored one after the other in memory. Lets try and visualize that, assuming that the allocation for the array started at the address 400, and that the size of an integer variable is 4 bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQHs3zDFZRB_0o4IDlIjnQ.png" /></figure><p>Simple enough right? Lets, for the sake of simplicity look at a zoomed out image of the same situation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*AUJtFMdHhq5U9wcDt2zeig.png" /></figure><p>Now try and imagine why the designers of the C programming language (or of the computer languages that were designed before C) came up with the concept of arrays?</p><p>It is actually something that would have naturally come up since there would be situations where you need to store information about, lets say, a 100 different things of the same data type and it would be counter-intuitive to expect the programmer to use a 100 different variables, right? After all, programs were meant to make use of computers with little effort.</p><p>Plus there is an added advantage of using arrays — speed. It may not seem obvious but in a situation where you have to read 100 variables, it will be faster if the variables are situated next to each other in memory, than scrambled about here and there where moving from one variable to the next would require larger and randomly placed jumps.</p><p>Essentially, declaring multiple separate variables does not guarantee that those variables will be situated next to each other. However, with arrays, you are explicitly (categorically) instructing the compiler to save a large block of unallocated memory that is enough to store the number of variables that you mentioned at the time of declaration.</p><p>Having gone through why we need arrays, lets now look at how we could use them. First thing that should pop up is that, since we saw that the entire array can be accessed using just one variable name, how can we access the individual elements that actually comprise the array.</p><p>This is where the [] operator comes in. It is used to access any element of the array using an <em>index</em>. Essentially, if there are 100 elements in an array, and we want to use the 20th element, we would say a[19]. Umm, What ??</p><p>Yes you read that right ! the index of the 20th element is 19. The reason is simple — The index should be looked at as the <strong><em>offset </em></strong>by which you need to move from the first element in order to reach the desired element.</p><p>Lets say you are at the very first element, and you want to move to the second element, then you would need to <strong><em>move by 1 element</em></strong>. So the second element could be accessed by saying a[1].</p><p>To move to the 3rd element you’d say a[2] and so on. <br>100th element would then be a[99].</p><p>Similarly, the first element would be accessed by, a[0].</p><p>Accessing an array of 10 elements would look like this:</p><pre>int a[10]={4,2,6,2,-3,5,-6,-3,9,2};<br>printf(&quot;%d %d %d %d %d %d %d %d %d %d&quot;,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);</pre><p>Obviously, first thing should pop up in you head is that if we had to access 10 elements of the array a, then certainly we would use a loop construct to sequentially access them. And you’d be absolutely correct !</p><p><strong><em>Loops and arrays</em></strong> are also, well, a <strong><em>match made in heaven</em></strong>. It makes sense to use arrays only because you could simply <em>loop</em> through the comprising variables, no matter how large the number of elements is !</p><pre>int a[10]={4,2,6,2,-3,5,-6,-3,9,2};<br>int i=0;<br>for( i = 0 ; i &lt; 10 ; i++ ){<br>    printf(&quot;%d &quot;,a[i];<br>}</pre><p>Since this article is about Pointers and arrays, lets now look at it from that perspective.</p><p>An array int a[10]; is a set of 10 integer variables that are contiguously stored in memory and accesses by a single identifier a.</p><p>Actually the index operator [] is nothing but a cleaner way to represent what is happening underneath. <br>Assume that the address of the array a (or the address of the first element of the array a) is 400. <br>Then the second element’s address is actually 400 + sizeof(int) = 404.<br>Third element’s address is 400 + 2 * sizeof(int) = 408<br>Fourth element’s address is 400 + 3 * sizeof(int) = 412<br>Ninth element’s address is 400 + 8 * sizeof(int) = 432</p><p><strong><em>i</em></strong>’th element’s address is 400 + i * sizeof(int)<br>OR<br><strong><em>i</em></strong>’th element’s address is : starting address of array + i * sizeof(int)<br><strong><em>i</em></strong>’th element’s value is : Value of address (starting address of array + i * sizeof(int))</p><p>Its almost as if there is a <strong><em>pointer to an int</em></strong> that has the address of the array stored in it and an addition of ‘i’ is being made to it.</p><pre>int a[10]={4,2,5,2,6,3,6,2,6,3};<br>int i = 5;<br>int *p = &amp;a;</pre><p><strong><em>i</em></strong>’th element’s address is simply p+i since we know from previous articles that an addition of an integer to a pointer variable means that jumps of the sizeof that data type are made, or i jumps of the sizeof(int) are made.</p><p><strong><em>i</em></strong>’th element’s value is *(p+i) , because, by definition of the indirection operator, *(address) means the value stored at that address.</p><p>All in all, a[i] is actually same as *(p+i) if the address of a is stored in p.</p><p>Now comes the interesting part,</p><blockquote>The identifier of an array actually acts like a pointer variable storing the address of the first element of the array.</blockquote><p>That doesn’t mean that you can do <em>everything</em> with it that a pointer can do, but you can still do some of pointer-ish things with it.</p><p>For example:</p><pre>int a[10]={2,5,1,5,2,5,1,5,2,6};</pre><pre>// assignment of the address of the array to a pointer:<br>int *p = a; // notice that there is NO &amp; operator used here.</pre><pre>// accessing 4th element without using the [] operator<br>printf(&quot;%d&quot;, *(a+3));</pre><pre>// storing address of 7th element in a pointer<br>int * q = a+7;</pre><pre>// what you can NOT do<br>a = a+4;</pre><p>You still can NOT assign anything to an array variable. Think about it. It makes sense. You asked the compiler to allocate 10 integers in one large chunk in memory to be accessed using identifier a and now suddenly you are asking the compiler to make the identifier point to a separate address. Seems awkward and is, which is why assignment to an array type is NOT allowed in C.</p><blockquote>Takeaway from this section : a[i] is same as *(a+i)</blockquote><p>Lets try something with pointers and ++ operators:</p><pre>int a[10] = {-3,7,-2,1,-7,2,3,4,5,6};<br>int *p = a, *q = a, *r = a, *s = a, *t = a;</pre><pre>int *x = p++;<br>printf(&quot;%p,%p,%d,%d\n&quot;,p,*p,x,*x);</pre><pre>int b = *q++;<br>printf(&quot;%p,%d,%d\n&quot;,q,*q,b);</pre><pre>int c = *++r;<br>printf(&quot;%p,%d,%d\n&quot;,r,*r,c);</pre><pre>int d = ++*s;<br>printf(&quot;%p,%d,%d\n&quot;,s,*s,d);</pre><pre>int e = (*t)++;<br>printf(&quot;%p,%d,%d\n&quot;,t,*t,e);</pre><p>Firstly, lets assume that address of a is 400.<br>Therefore p, q, r, and s all have value 400.</p><p>int *x = p++; here value stored in p is incremented by 1; But since p is of ‘<em>pointer to int</em>’ type, therefore <br>actual value in p becomes ‘<em>address already stored in</em> p +1*sizeof(int)’<br>Note that actual value of p is incremented <strong>AFTER </strong>the assignment to the r operator is finished, since it is a <em>post</em> ++ operator)</p><p>Output, therefore should be 404,7,400,-3</p><p>int b = *q++; here the ++ operator is a suffix/postfix operator (occurring after the operand), and that actually has the <strong><em>highest priority</em></strong>.</p><p>Therefore, the value stored in q is incremented by 1 (but since q is pointer to int, it is incremented by sizeof(int)),</p><p>which brings us to int b = *(q++);</p><p>The value of q is incremented <strong>AFTER </strong>the assignment to b is over, since it is a post ++ operator. Therefore, first the <strong>* </strong>operator is applied on the original value of q before the value of q is incremented.</p><p>b will therefore store value at address 400.<br>q will now have address 404.</p><p>Output, therefore should be 404,7,-3</p><p>int c= *++r; since * has higher precedence than <em>pre</em> ++ , you may think that * has to be applied first. But since * operator is not exactly sitting next to the identifier r , therefore, regardless of the operator precedence, <em>pre</em> ++ will be applied <strong><em>BEFORE</em></strong> the * operator.</p><p>Value of r is immediately incremented, and then value at the new address is stored in c .</p><p>Output therefore should be 404,7,7</p><p>int d = ++*s; actually is int d = ++(*s); which means pre-increment the value stored at the address stored in s , which means that increment value at address 400, which is the first element of the array (-3). Therefore the first element of the array now has value = -2.</p><p>Output therefore should be 400 -2 -2</p><p>int e = (*t)++; increment value at address 400, but after assigning value at 400 to e.</p><p>Output therefore should be 400 -1 -2</p><p>Note that we have assumed that address of a is 400. But running this code on a compiler, you would see that the address of a is not going to be 400. It’ll be something different. We’ve just assumed 400 for the sake of simplicity.</p><p>Hope you are having fun and learning things as well in this vast ocean of concepts related to pointers! This is, by no means the end of pointers, as there is still, a lot more to cover, which I will in the upcoming stories.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68fff2d2b3d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sillyquestions/5-pointers-and-arrays-match-made-in-heaven-68fff2d2b3d1">5. Pointers and Arrays : Match Made in Heaven</a> was originally published in <a href="https://medium.com/sillyquestions">sillyquestions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4. More on Pointers]]></title>
            <link>https://medium.com/sillyquestions/4-more-on-pointers-66dc2f516d?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/66dc2f516d</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[pointers]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Thu, 01 Jun 2017 17:10:48 GMT</pubDate>
            <atom:updated>2017-06-01T17:10:48.434Z</atom:updated>
            <content:encoded><![CDATA[<p>Lets start with something basic:</p><pre>int a,b,c;<br>double p,q,r;<br>int* f,g,h;</pre><p>Seems simple enough, right? It is ! First 2 lines are declarations of int and double type variables respectively. <br>Line 3 is a declaration statement for 3 pointers to integers, right ?<br>WRONG! f has type int *, however g, and h are simple integer types.</p><blockquote>Point to remember: The * in declaration statement is not bound to the data type before it, but to the identifier.</blockquote><p>Lets now take a look at the <strong>*</strong> operator a bit more. Since it is indeed an operator, it will be somewhere in the <strong>order of precedence of operators</strong>.</p><p><a href="https://en.wikipedia.org/wiki/Order_of_operations"><em>Precedence of operators</em></a>: It simply means that in a statement having multiple operators, an order needs to be dictated to determine which operator will be considered and evaluated first.</p><pre><strong>p = a + b * q - r / 5 * 4;</strong></pre><p>Obviously, there are rules for evaluation here as well similar to ordering rules in mathematics. At first instinct, you may think that the simple BODMAS rule, which we have all learnt in school, shall apply. However, that is not how a computer works! In the C programming language, * and \ both have the same status in the order of precedence.</p><p>A natural progression to that discussion should be : In the above statement, both <strong>/</strong> and <strong>* </strong>occur together. Therefore, who gets to go first ?</p><p>Answer to that is <strong>associativity of operators</strong> !</p><p><a href="https://en.wikipedia.org/wiki/Operator_associativity"><em>Associativity of operators</em></a>: It is a property that determines how operators of the same precedence are grouped in the absence of paranthesis.</p><blockquote>Order of evaluation of operators of a statement is determined by two factors : Operator Precedence and Operator Associativity</blockquote><p>Rules governing operator precedence and associativity for C Language:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*s6tkQBn3PuvIlRhaOF_FPg.png" /><figcaption><a href="http://en.cppreference.com/w/c/language/operator_precedence">http://en.cppreference.com/w/c/language/operator_precedence</a></figcaption></figure><p>The above is a complete, exhaustive list. All operators are covered and this image alone is enough to evaluate a statement, no matter how complex it is.</p><p>Lets do a simple exercise. Nothing fussy. <br>Use the diagram above for reference.</p><pre>int q = a*b+c-d/3^4&amp;2;</pre><pre>// task is to just put paranthesis in the above expression assuming <br>// all the identifiers used are valid integer variables<br>// NO NEED to actually evaluate anything</pre><pre>int q = ((((a*b)+c)-(d/3))^(4&amp;2));</pre><pre>// how i got there :</pre><pre>// since * and / are of the same level (highest) and associativity // is from left to right therefore * is picked as it appears on the // left<br>a <strong>*</strong> b + c - d / 3 ^ 4 &amp; 2;  <br>( a * b ) + c - d <strong>/ </strong>3 ^ 4 &amp; 2 ;</pre><pre>//since + and - are of same level and + occurs on left,<br>( a * b ) <strong>+ </strong>c - ( d / 3 ) ^ 4 &amp; 2 ;<br>( ( a * b ) + c ) -<strong> </strong>( d / 3 ) ^ 4 &amp; 2 ;<br>( ( ( a * b ) + c ) - ( d / 3 ) ) ^ 4 &amp; 2 ;</pre><pre>// since &amp; has higher precedence than ^<br>( ( ( a * b ) + c ) - ( d / 3 ) ) ^ ( 4 &amp; 2 ) ;<br>( ( ( ( a * b ) + c ) - ( d / 3 ) ) ^ ( 4 &amp; 2 ) ) ;</pre><p>Now that you look at it, its actually pretty simple. Follow the steps.</p><ol><li>Find the operator with the highest priority in the level of precedence</li><li>If there are multiple occurrences of operators of the same level, then look at the associativity rule for that level. If it is <em>‘left to right’ </em>then chose the leftmost operator, else if it is <em>‘right to left’</em> then chose the rightmost operator.</li></ol><p>Lets try out some more examples :</p><pre>q = r &gt; 4 ? f &lt;&lt; h / 6 - 5 * 4 : !j != t ;</pre><pre>// highest level of operator is the <strong><em>unary ! </em></strong>operator<br>q = r &gt; 4 ? f &lt;&lt; h / 6 - 5 * 4 : (!j) != t ;</pre><pre>// next highest is <br>q = r &gt; 4 ? f &lt;&lt; ( h / 6 ) - (5 * 4) : (!j) != t ;</pre><pre>// next highest is -<br>q = r &gt; 4 ? f &lt;&lt; (( h / 6 ) - (5 * 4)) : (!j) != t ;</pre><pre>// next highest is bitwise left shift &lt;&lt;<br>q = r &gt; 4 ? ( f &lt;&lt; (( h / 6 ) - (5 * 4) ) : (!j) != t ;</pre><pre>q = ( r &gt; 4 ) ? ( f &lt;&lt; (( h / 6 ) - (5 * 4) ) : (!j) != t ;<br>q = ( r &gt; 4 ) ? ( f &lt;&lt; (( h / 6 ) - (5 * 4) ) : ((!j) != t) ;<br>q = <strong>( r &gt; 4 ) </strong>?<strong> </strong>( f &lt;&lt; (( h / 6 ) - (5 * 4) ) : ((!j) != t) ;</pre><pre>// if the result evaluates to true, then <strong><em>(f&lt;&lt;((h/6)-(5*4))<br></em></strong>// else ((!j) != t)</pre><pre>finally the assignment operator is evaluated (since it is lowest among the available operators (14 in the diagram above)!</pre><p>One more for practice (simply put paranthesis, no need to evaluate; assume that all indentifiers are of type int and that f() also returns an int):</p><pre>a *= b + !!g &lt;&lt; 2 | 4 &amp;&amp; 4 - e ~y + sizeof(int) / 35 + f();</pre><p>Now lets actually look at the indirection operator (*) in the precedence;</p><pre>int a = 5;<br>int *p = &amp;a;<br>int q = *p*r+1;</pre><pre>// the first * is pretty high in the level of precedence (indirection operator)<br>// int q = (*p) *r+1;<br>// int q = ((*p)*r)+1);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66dc2f516d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sillyquestions/4-more-on-pointers-66dc2f516d">4. More on Pointers</a> was originally published in <a href="https://medium.com/sillyquestions">sillyquestions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3. Little more about Pointers]]></title>
            <link>https://medium.com/sillyquestions/3-little-more-about-pointers-81a25543fabc?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/81a25543fabc</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[pointers]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Wed, 24 May 2017 18:54:01 GMT</pubDate>
            <atom:updated>2017-05-24T18:54:01.883Z</atom:updated>
            <content:encoded><![CDATA[<p>Lets get a bit more ambitious now:</p><pre>int a = 5;<br>int *ptr = &amp;a;<br>int ** ptr2 = &amp;ptr;</pre><p>Woohh! What ??!!?? Two stars together!!</p><p>This is called ‘<strong>adding another level of indirection</strong>’.<br>(it is a very simple phrase but has far reaching consequences that you will get to know once you are no longer a beginner in programming.<br>Read : <a href="https://en.wikipedia.org/wiki/Fundamental_theorem_of_software_engineering">Fundamental Theorem of Software Engineering</a>)</p><p>Coming back, we already know what the first two lines mean. Lets try and look at the third :</p><pre>int ** ptr2 = &amp;ptr;</pre><p>RHS evaluates to : address of the variable ptrwhich we already know to be 820. (Numbering in continuation with the previous story)</p><p>LHS is, well,</p><blockquote>Allocate memory for storing a pointer to a pointer that will point to an integer<br>OR<br>Allocate memory for storing the address of a variable which stores the address of an integer variable and label it with the identifier ‘ptr2’</blockquote><p>Since address of a variable storing an address is still an address, we still need only 4 bytes of memory!</p><blockquote>Allocate 4 bytes of memory for ptr2 to store address of a pointer to an integer</blockquote><p>Simple!</p><p>Using the ‘*’ operator on the RHS we can do:</p><pre>int c = **ptr2; // also equal to 5</pre><p>How is <strong>**ptr2</strong> (in the RHS) understood by the compiler ?<br>Lets just try <strong>*ptr</strong>:</p><p>Value stored at address stored in ptr2<br>=Value stored at 820</p><p>Now lets try **ptr2, or *(*ptr2) :</p><p>Value stored at address stored at *ptr2<br>=Value stored at 250<br>= 5</p><p>Doesn’t seem too complicated now, eh !</p><p>You may be wondering that we can then also have 3 levels of indirection</p><pre>int ***ptr3 = NULL; // notice the extra *</pre><p>Yes, you can absolutely do that! I’m not too sure if ridiculously high levels if indirection would be practical or useful for that matter, but there isn’t any theoretical limit to the levels of indirection allowed in C.</p><p>Lets now look at basic pointer arithmetic.<br>Since pointers store, well, integers, arithmetic operations allowed for int variables should also be allowed for pointers.</p><p>Therefore, simple addition and subtraction operators are allowed. However, multiplication or division operations with at least one operand as a pointer is not allowed because there could be no justifiable reason to multiply addresses.</p><pre>int a = 5;<br>int *ptr = &amp;a;<br>int *ptr2 = ptr*ptr; // NOT allowed as no use multiplying addresses<br>int *ptr3 = ptr/ptr; // NOT allowed as no use multiplying addresses</pre><p>Lets take a look at addition and subtraction using pointers:</p><pre>int a = 5;<br>int *ptr = &amp;a;<br>int *ptr2 = ptr+5;<br>int *ptr3 = ptr-2;<br>int *ptr4 = ptr+ptr; // NOT Allowed</pre><p>First 4 statements are allowed and we will look a little more closely at them, but the last line is <strong><em>NOT</em></strong> allowed as adding an address with an address again will make no sense.</p><p>Then you may ask, why is addition/subtraction of an actual integer value with a pointer allowed ? <br>Because it makes sense to say <em>‘Go to that address and take 4 steps further or 6 steps back’</em> !</p><p>Now lets take a look at what actually happens when we add/subtract an integer to/from a pointer :</p><pre>int a = 5;<br>int *ptr = &amp;a;<br>int *ptr2 = ptr + 2;</pre><p>Lets try to visualize this similar to what we did earlier when we learnt about allocation.</p><p>a is an integer storing the value 5and having an address, say 250.<br>ptr is a pointer to an integer storing the address of a ( 250) and it itself has an address, say 650.<br>ptr2is also a pointer to an integer and it stores int 2 + value stored in ptr</p><p>Lets take a moment here and try and guess what this last statement here would evaluate to.</p><p>First instinct might suggest that since addresses are integers, we do simple addition and get 650+2=652</p><p>Lets try and now analyse whether this is the value it should actually evaluate.</p><p>650–653 are actually bytes reserved for the variable ‘ptr’; And we also know that reading an integer from the middle of the block will result in unexpected situations.</p><p>Therefore, there is reason to believe that this doesn’t seem right. <br>It isn’t.</p><p>Since a pointer to an integer, is meant to store address of integer variables, and an integer will occupy 4 bytes, therefore scalar addition (adding a finite integer) to an address should make jumps of the size of 4 bytes.</p><p>What I’m trying to say is, that if we write,</p><pre>int *ptr3 = ptr + 5;</pre><p>the evaluation of ptr + 5 should add (5 x _size of an integer_ ) to the address. In other words, if a is an address (of an integer variable), and we intend to perform addition/subtraction of an integer value ion it,<br>the result should be <br> a+i*sizeof(int)OR<br> a-i*sizeof(int)</p><p>Lets just assume that this is true even if it doesn’t seem obvious, and we’ll revisit this scenario in a section that covers pointers and arrays.</p><p>Similarly ,<br>for other data types, if we perform addition/subtraction of an integer with an address (of a particular data-type), the jumps will be equal to the size of the data-type.</p><p>Try running the code below, and try making sense out of the result you obtain. Remember that pointers store addresses, and are represented specifically in hexadecimal format (base 16), and not in plain integer format, like we have been assuming all this while (that was to make things easier to understand).</p><pre>// Try for yourself<br>int a = 5;<br>int *ptr = &amp;a;<br>int *ptr2 = ptr+3;<br>int *ptr3 = ptr-5;<br>printf(&quot;\n%d %p %p %p&quot;,sizeof(int),ptr, ptr2,ptr3);</pre><pre>double b = 4.998;<br>double *ptrb = &amp;b;<br>double *ptrb2 = ptrb+3;<br>double *ptrb3 = ptrb-5;<br>printf(&quot;\n%d %p %p %p&quot;,sizeof(double),ptrb, ptrb2, ptrb3);</pre><p>Small exercise below : (Try analyzing and/or running the code and then read the explanation below it)</p><pre>int *p;<br>*p = 100;<br>//////////////////////////////////<br>int a = 5;<br>int *p2 = &amp;a;<br>printf(&quot;\n%d %d %p&quot;,a,*p2,p2);<br>*p2 = 4;<br>printf(&quot;\n%d %d %p&quot;,a,*p2,p2);</pre><p>Lets first try and look at the first section:</p><p>int *p; this is an instruction to the compiler to allocate 4 bytes of memory for identifier p to store address of an integer variable. There is <strong><em>NO</em></strong> mention of what value to assign to it! Therefore, compiler won’t bother setting any value to the bytes reserved for the pointer.</p><p>*p = 100; this is an instruction to the compiler to assign 100 to address stored in pointer variable p . Now, since there was no formal assignment to the pointer p , therefore it will have a value that you can’t possibly know or expect, which means that to an arbitrary address, you are instructing the compiler to assign a value. This will be a classic case of unexpected behavior.<br>However, it is not something that a C Compiler should and must detect, so it may run without compile time errors, but it surely will result in nasty run time errors if you try to become too ambitious and edit sections of memory you should have no business tampering with.</p><pre>int a = 5;<br>int *p2 = &amp;a;<br>printf(&quot;\n%d %d %p&quot;,a,*p2,p2);<br>*p2 = 4;<br>printf(&quot;\n%d %d %p&quot;,a,*p2,p2);</pre><p>In this section, first 3 lines are pretty obvious by now and we won’t go through the same again. <br>The third line *p2 = 4; is interesting. <br>p2 will store the address of a and *p2 typically means “value at address stored in p2”. Therefore, *p2 = 4; will try and attempt assignment of value 4 to the address stored in p2 , which of course is the address of variable a .</p><p>Try and guess the output of the last line of the section and try to match it with the output you get if you run the same.</p><p>We have come a <strong><em>long</em></strong> way actually from a trivial integer declaration statement, but still have a lot to cover, as the things you can achieve using pointers are limitless.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81a25543fabc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sillyquestions/3-little-more-about-pointers-81a25543fabc">3. Little more about Pointers</a> was originally published in <a href="https://medium.com/sillyquestions">sillyquestions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2. Pointers in C : Don’t be scared !]]></title>
            <link>https://medium.com/sillyquestions/2-pointers-in-c-dont-be-scared-28ec592f2f40?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/28ec592f2f40</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[pointers]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[variables]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Mon, 22 May 2017 19:06:54 GMT</pubDate>
            <atom:updated>2017-06-03T09:25:16.439Z</atom:updated>
            <content:encoded><![CDATA[<p>It is perhaps the most challenging topic for people starting programming in C. It shouldn’t necessarily be that way, though.</p><p>That is because pointers are just like other variables with some added functionality. At the heart of it, pointers are just variables that store “addresses”.</p><p>Lets start with the absolute basics.</p><p>A variable declaration with initialization goes something like this:</p><pre>int a = 5;</pre><p>This is an instruction to the compiler to allocate a block of memory enough to store an integer variable and assign it a value 5;</p><p>Key point being : <strong>‘allocate a block of memory’</strong></p><p>Lets say if for a particular compiler and an OS, the size of an integer is 4 bytes, (which it is most often, by the way). Therefore, 4 bytes of memory are allocated for the integer a;</p><p>Since there will be so many allocations/deallocation of variables, there needs to be a proper system to manage and work with all of that.</p><p>Therefore every exact point (read:<strong> every byte</strong>) in memory has an <strong>address</strong>. Lets look at the below diagrams to understand the concept of memory allocation.</p><p>Lets say that for the allocation of a, the compiler found a free space of 4 bytes starting from address 250. So it will now reserve 4 bytes of memory starting from 250 for the <strong><em>identifier</em></strong> a.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*PxsYofdE3M5sT4eJuUNHFg.png" /><figcaption>250–253 are bytes of memory now reserved for identifier ‘a’</figcaption></figure><p>So there is an integer (occupying 4 bytes) having ‘<strong>address</strong>’ as 250 and this block of 4 bytes will be referred to using the identifier as a.</p><p>Phew, that was long and probably a bit redundant, but this entire thing is the <strong>crux of everything related to pointers</strong> (even though i haven’t even talked about pointers yet!)</p><p>Lets finally talk about pointers.</p><p>A ‘<strong>Pointer</strong>’ is simply a variable that stores an <strong><em>address</em></strong>. Addresses are basically integers. Therefore, it is safe to say that :</p><blockquote>pointers actually store <strong>addresses </strong>similar to how integers are stored in memory.</blockquote><p>If you think about it, since you can store an address in a pointer variable, you can store the address of any point in memory. However, since variables are stored in a very particular format, the addresses you can store in a variable should <strong>not</strong> be completely arbitrary.</p><pre>int a;</pre><p>The above statement virtually creates an integer in memory location starting from 250 and stretching 4 bytes.</p><p>Lets now take an example of a pointer declaration.</p><pre>int *ptr;</pre><p>This statement is similar to a normal integer declaration. <br>The compiler tries to make sense of this statement by reading declaration as:</p><p><strong>A variable declaration that stores * of int and has the identifier ‘ptr’</strong></p><p>Read this as:</p><blockquote>A variable declaration that stores the address of an integer and has the identifier ‘<strong>ptr</strong>’.</blockquote><p>Since an address is basically an integer, the compiler tries to find 4 free <br>(not yet allocated to anythings else OR <strong>unallocated</strong>) bytes of memory and links it to the identifier ‘<strong>ptr</strong>’.</p><p>Lets say the pointer gets the address 820. Cumulatively 820,821,822 and 823 will store one integer value that will actually be the address of some other variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*tSNy_nqlW0Z5yrr_wwbPYA.png" /><figcaption>820–823 are bytes reserved for the identifier ‘ptr’ that will store the address of an integer</figcaption></figure><p>In C, if you only do a variable declaration <strong>without any initialization,</strong></p><pre>int a;<br>int b;<br>int *ptr;</pre><p>you end up not doing anything to the data that would be stored previously in those sequence of bytes.</p><p>820–823 can previously be having any value, and a C Compiler need not necessarily bother about assigning value to it unless specifically asked to do so. In such circumstances of ‘uninitialized variables’, unexpected things might happen that you may not have accounted for.</p><p>Even worse if that chunk of memory is supposed to store an address. you wouldn’t want any wrong things happening to an arbitrary address as that arbitrary seeming address may contain information crucial to some other part of your code, or worse your OS. Compilers therefore have provisions of not allowing you to access restricted areas of the memory.</p><blockquote>Thumb rule: Always initialize a variable while declaring it!</blockquote><pre>// Correct way to declare and initialize variables:<br>int a = 0;<br>int b = 0;<br>int *ptr = NULL;</pre><p>Looking at the last statement, we encounter the NULL term. <br>Pointers are used to do interesting stuff. If one had to actually write addresses by hand in declarations, it would make no sense. Basically, a programmer will never need to use actual addresses in the code because it is something that is <strong>abstracted out </strong>(unnecessary implementation details hidden) and also because there is absolutely no certainty that the compiler would,at all times use the exact same address in memory to do the exact same thing.<br><strong>NULL is basically the ‘zero’ of addresses.</strong></p><p>(Side note: whenever you read ‘<strong>memory</strong>’, think <strong>RAM</strong> and never disk or any other persistent (permanence of data stored) form of storage. All tasks on a computer happen by <strong>copying things to the RAM</strong> and then actually performing operations from there.</p><p>Performing operations on a persistent storage will be too slow and cumbersome as <strong>read/write speeds of RAM will be far superior to read write speeds of persistent storage</strong>)</p><p>Coming back, lets now see how to actually make good use of pointers using it to store variable addresses.</p><pre>int * ptr = &amp;a;</pre><p>Read as : <strong>allocate 4 bytes in memory (for identifier ‘ptr’) to store the address of an integer, and assign it a value which is the address of the identifier ‘a’.</strong></p><blockquote><strong><em>&amp;</em></strong> operator in C means <strong><em>‘address of’</em></strong></blockquote><p>The variable ahas an address 250 (I know that 4 bytes cumulatively store whatever value it is supposed to, but the starting address and its length is also enough to know how many bytes to read.) Therefore, address of any variable, in general, is denoted by <strong><em>just the address of the first byte</em></strong> it occupies in memory.</p><p>(Another side note: when i say 4 bytes cumulatively store an integer it means <br>that : 4 bytes = 4 x 8 = 32 bits.</p><p>32 bits will cumulatively store the value. Since, <br>5 converted to binary is : 101<br>or simply, <strong>5 base 10 = 101 base 2</strong></p><p>101 is stored to the rightmost 3 bits of the variable starting at 250 and all bits coming before it are set to zero (0).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*PQ-ppQZ2CtzecX21i34qyw.png" /></figure><p>Other examples (assuming b and c have addresses 375 and 405, respectively) :</p><pre>int b = 142; // 10001111<br>int c = 32756; // 111111111110100</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*AehrrC4qXf-lgpuN32jCOw.png" /></figure><p>Lets not digress into negative numbers and their representation and leave it probably for another article.</p><p>Coming back to pointers, lets look at the pointer declaration (with initialization below)</p><pre>int * ptr = &amp;a;</pre><p>Question arises, that if pointers store just addresses, then what is the need to tell it the <strong><em>kind</em></strong> of variable whose address it is going to store?</p><p>To answer that question, we need to first know what we can do with an address.</p><p>Naturally we’d want to do some cool stuff with the address. We can treat it like an integer and do things but it wont perform things like we’re used to (explanation a bit later). We would want to access that value stored at the address we have with us.</p><p>That is where the * operator comes in.</p><p><strong>*</strong> happening on the a <strong><em>declaration statement</em></strong> side of an expression means that the memory allocation is for a pointer variable . (eg: int *ptr;)</p><p>* occurring on <strong><em>any other expression</em></strong> is basically : ‘<strong>value stored at the address</strong>’</p><pre>printf(&quot;%d&quot;, *ptr); // result is : 5</pre><p><strong><em>Explanation</em></strong><em>:</em> <br><strong>*ptr</strong> is interpreted as<br>‘<strong>Value stored at</strong> the <strong>__address that is stored in </strong><strong>ptr__</strong>’<br>OR <br>‘<strong>Value stored at</strong> the <strong>__address </strong><strong>250__</strong>&#39;</p><p>Lets now take a look at a situation where the <strong>* </strong>operator is, for a change, on the left hand side of an assignment.</p><pre>int b = 6;<br>int *ptr2 = &amp;b;<br>*ptr2 = 15;<br>printf(&quot;%d %d&quot;,b,*ptr); // 15 15</pre><p>Carefully look at line number 3 here, *ptr2 = 15; <br>We try and comprehend the statement as “assign 15 to value at address stored in ptr2”. So it tries to change the value at the location which is reserved for b . Naturally the value of b will change to 15 because b is itself just an identifier, and the actual value is stored in a concrete location in memory.</p><p>Hopefully, now we’ve learnt how to use <strong>*</strong> operator in declarations, and on both sides of an assignment operator!</p><p>Lets go back to the question : why we need a data type to go along with a pointer declaration when its basically just storing an address?</p><p>Thing is, for something like,</p><pre>int y = *ptr;</pre><p>the compiler is being asked to evaluate the RHS as <br><strong>‘the value stored at the address that is stored in ptr’</strong></p><p>To read the value starting at 250, the compiler needs to know how many bytes to read !</p><p>4 bytes? 1 byte ? 10 bytes ?</p><p>lets say we write:</p><pre>double x = 4.9;<br>int* ptr_x = &amp;x;<br>int y = *ptr_x;</pre><p><strong><em>double</em></strong> takes <strong>8 bytes</strong> of memory (again compiler and OS dependent).</p><p>Lets say the value of 4.9 is stored in the 8 bytes starting at, say, 670.<br>‘ptr_x’ simply needs to store an address, and it stores the address 670 in itself.</p><p>When you do *ptr_x on the RHS (line 3 above), the compiler starts reading value stored at the location “STARTING” from 670. It now needs to know how many bytes to read, to actually get the value 4.9; <br>It needs to know : <strong><em>‘read 8 bytes starting at address 670’</em></strong></p><p>If it read just 4 bytes it would only bytes 670–673 which would be incomplete and incorrect information, which is what would happen if you store address of a double in an integer (you’d lose information ! )</p><p>This would lead to unexpected behaviour and therefore, is not allowed by the compiler.</p><blockquote>Thumb rule : you can only assign the address of a variable to a pointer to the same data type (just so that it know how many bytes to read !)</blockquote><p>Hopefully that clears things just a little bit. Now i’d dare to say something that’d sound very strange :</p><p>If you really understand the following 3 statements at a very basic level, you can very simply master the art of using pointers →</p><pre>int a = 5;<br>int * ptr = &amp;a;<br>int x = *ptr;</pre><p>If yes, awesome! lets move ahead to the next article, else go back and give this article another patient read from the beginning, and hopefully things become clear.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28ec592f2f40" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sillyquestions/2-pointers-in-c-dont-be-scared-28ec592f2f40">2. Pointers in C : Don’t be scared !</a> was originally published in <a href="https://medium.com/sillyquestions">sillyquestions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1. Programming in C : Introduction to Computer Progams]]></title>
            <link>https://medium.com/sillyquestions/1-programming-in-c-introduction-to-computer-progams-9e76bab059e0?source=rss-b3bd8b56d211------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e76bab059e0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Darshan Shah]]></dc:creator>
            <pubDate>Tue, 21 Mar 2017 20:03:19 GMT</pubDate>
            <atom:updated>2017-03-21T20:07:44.669Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>computer program</strong> is a collection of instructions that performs a specific task when executed by a computer.</p><p>Simply put, a computer program is a way of us humans who use computers (which makes us users), to ask the computer to do something. It may be as simple as displaying something on a screen or as complex as a computer game.</p><p>Computers are a complex machines capable of doing a lot of things because of the way humans have designed them and also how much evolution has happened. Underneath the computers are circuits that are designed to facilitate flow of information using On/Off signals.</p><p><strong>Low-level computer programs</strong> are such where commands or functions in the language map closely to processor instructions. As programs became more and more complex, it became difficult to write hundreds (perhaps thousands) of lines of code and therefore there was a need to make things simpler for people who wrote code.</p><p><strong>High-level computer programs</strong> were then designed such that there was no need to write low-level commands to interact with the processor. Fewer lines of code could satisfy the same functionality.<br>This is an example of a concept that is used everywhere in computer <br>science — <strong>Abstraction</strong>.</p><p>As per the Wikipedia article on abstraction :</p><blockquote>Abstraction is a technique for arranging complexity of computer systems. It works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level.</blockquote><p>Read the above line slowly, but don’t worry if you don’t understand what it means. You will gradually understand what it means.</p><p>The question that can be asked here is <br>‘Its cool that life was made simpler by coming up with high level code, but the processor still understands only basic instructions. Who does this conversion from high-level code to low-level code?’</p><p>Answer : <strong>Compiler</strong>.</p><p>A compiler converts high level code to low level code.</p><p>Just like two humans can communicate in using one of many ‘<strong>languages</strong>’ which provide a structure and is understood by both, there needs to be such a system for computer programs as well.</p><p>‘<strong>Computer Languages</strong>’ were developed to provide a structured communication format between the programmers and the compiler. There exist hundreds (perhaps thousands) of programming languages.</p><p><strong><em>C</em></strong> is actually a middle level language because it can be used to perform operations close to the machine level as well as write application programs (high-level applications).</p><p>C is therefore, in my opinion, is an excellent choice to start learning computer programming if you are a Computer Science/Information Technology student. (Low level code is difficult to start off with and high level code have constructs that are difficult to appreciate without knowing why they had to be designed that way)</p><p>To write code, we need <br>1. A Text Editor (eg: Notepad) : applications that allow us to write and edit text.<br>2. A Compiler (eg: Gcc)</p><p><strong><em>IDE’s</em></strong> (Integrated Development Environment) have been developed to provide text editing, compilation and other sophisticated capabilities that aid in this process of development of computer programs.</p><p>However, it is suggested that a beginner should start with just a <em>text editor and a compiler</em> so as to <strong>make</strong> silly mistakes and learn from them.</p><p><strong><em>Note:</em></strong> there are terms in this article that a beginner might not understand, but its perfectly alright. Try doing a google search on those terms. In case that is not fruitful enough, relax! With time you will understand what these terms mean.</p><p>Hope that you will enjoy and appreciate the beauty of computer programming !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e76bab059e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sillyquestions/1-programming-in-c-introduction-to-computer-progams-9e76bab059e0">1. Programming in C : Introduction to Computer Progams</a> was originally published in <a href="https://medium.com/sillyquestions">sillyquestions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>