<?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 Santhosh on Medium]]></title>
        <description><![CDATA[Stories by Santhosh on Medium]]></description>
        <link>https://medium.com/@santhosh-s?source=rss-2a1266d0709------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1iqllrFbvSQcdznmJWHQ_g.jpeg</url>
            <title>Stories by Santhosh on Medium</title>
            <link>https://medium.com/@santhosh-s?source=rss-2a1266d0709------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:06:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@santhosh-s/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[A fact about computer science, programming and AI]]></title>
            <link>https://santhosh-s.medium.com/a-fact-about-programming-and-computer-science-and-ai-25559472c5e5?source=rss-2a1266d0709------2</link>
            <guid isPermaLink="false">https://medium.com/p/25559472c5e5</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Santhosh]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 17:29:01 GMT</pubDate>
            <atom:updated>2026-02-07T17:44:10.192Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rrRlGtZWHwuOO6ze" /><figcaption>Photo by <a href="https://unsplash.com/@omilaev?utm_source=medium&amp;utm_medium=referral">Igor Omilaev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I’ve been learning computer science and programming for almost 10 years, and from the first day of programming it’s always been fascinating and amusing to see how it works like <strong>magic</strong>. ✨</p><p>Yes, I am a believer of magic (a big fan of Harry Potter ), and whenever I am programming to do something, I see it some sort of a <strong>magic</strong>!</p><p>And it’s literally aligns with the definition of magic from Google as well!</p><blockquote>magic — the secret power that some people believe can make strange or impossible things happen if you say special words or do special things.</blockquote><p>At the time I am writing this blog, <strong>AI agents</strong> are capable of replacing software engineers and tools like <strong>ChatGPT</strong> are capable of replacing your best friends.</p><p>The world is changing (as always!) so fast in this AI era and people are losing their jobs due to massive layoffs happening in the tech industry.</p><p>But is this because of advancement of AI in recent times? If you think so, then actually it is not!</p><p>Long ago, a breakthrough in humanity happened when we started to <strong>automate</strong> things that are repetitive or tedious!</p><p>If we start from the beginning of the history of computer science, it’s so obvious that computers are just machines which follows a set of instructions (a.k.a algorithms) to automate something!</p><p>From calculating a sum of integers to predicting and recommending your next movie, everything is based on <strong>automation.</strong></p><p>And I believe that’s the fact which stays as foundation of computer science and all its branches.</p><p>I see <strong>AI</strong> being a branch of computer science as the next phase of <strong>automation, </strong>not the one replacing us!</p><p>Instead of blaming AI let’s embrace the changes, learn new skills, and adopt as we always did as computer science students!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25559472c5e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up debugger for Express app with Node.js and Typescript in WebStorm in just 3 steps!]]></title>
            <link>https://santhosh-s.medium.com/setting-up-debugger-for-express-app-with-node-js-and-typescript-in-webstorm-in-just-3-steps-1a619e15ef6a?source=rss-2a1266d0709------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a619e15ef6a</guid>
            <category><![CDATA[webstorm]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[debugger]]></category>
            <category><![CDATA[jetbrains]]></category>
            <dc:creator><![CDATA[Santhosh]]></dc:creator>
            <pubDate>Sat, 19 Jul 2025 10:07:22 GMT</pubDate>
            <atom:updated>2025-07-19T10:20:53.947Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UzOeTJANIQdiKPPMxsjA3Q.png" /><figcaption>Debugger setup for Node.js + TS + Express in WebStorm</figcaption></figure><p>I know why you are here and let’s start with the debugger setup!</p><ol><li>Once you are done with the basic setup of your Node.js + TS + Express setup, I am assuming that you are having package.json scripts somewhat like this 👇🏻</li></ol><pre>&quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;tsc&quot;,<br>    &quot;build:watch&quot;: &quot;tsc --watch&quot;,<br>    &quot;start&quot;: &quot;node dist/server.js&quot;,<br>    &quot;dev&quot;: &quot;nodemon --watch dist -e js,json dist/server.js&quot;,<br>    &quot;test&quot;: &quot;jest&quot;,<br>    &quot;test:watch&quot;: &quot;jest --watchAll&quot;,<br>    &quot;test:coverage&quot;: &quot;jest --coverage&quot;,<br>    &quot;dev:debug&quot;: &quot;nodemon --inspect=9229 --watch dist -e js dist/server.js&quot;,<br>    &quot;dev:concurrent&quot;: &quot;concurrently \&quot;npm run build:watch\&quot; \&quot;npm run dev:debug\&quot;&quot;<br>  },</pre><p>2. Click on Run &gt; Edit Configurations &gt; + &gt; Attach to Node.js/Chrome. Give name as “Debug” or whatever, keep <strong>Host</strong> as localhost and <strong>Port</strong> as 9229 and check, “Reconnect automatically” and Click on <strong>OK</strong></p><p>3. You must see these on top right corner, execute both of them! Drop a breakpoint somewhere in your .ts file and start debugging!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*GoFkCDhpP8z_DmkvTZr5Yg.png" /><figcaption>Debug configuration</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a619e15ef6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up Apache Kafka in Less Than a Minute ⚡️]]></title>
            <link>https://santhosh-s.medium.com/setting-up-apache-kafka-in-less-than-a-minute-%EF%B8%8F-cf42967f10fe?source=rss-2a1266d0709------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf42967f10fe</guid>
            <category><![CDATA[local-development]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[message]]></category>
            <category><![CDATA[local-setup]]></category>
            <category><![CDATA[streaming]]></category>
            <dc:creator><![CDATA[Santhosh]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 08:48:38 GMT</pubDate>
            <atom:updated>2024-12-31T08:48:38.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/905/0*Ga4ojmkiZ4J1qka4.png" /><figcaption>Apache Kafka</figcaption></figure><p>One of the major challenges with Apache Kafka has always been its initial setup. However, with the help of Docker, you can get Kafka up and running in under a minute! Let’s dive in.</p><h4>What’s New in Apache Kafka?</h4><p>Previously, Apache Kafka relied on two components:</p><ul><li><strong>Kafka Cluster</strong>: For processing and storage.</li><li><strong>ZooKeeper</strong>: For managing metadata and cluster configurations.</li></ul><p>With the introduction of <strong>KRaft Mode</strong> (Apache Kafka Raft), Kafka has removed its dependency on ZooKeeper. KRaft simplifies Kafka’s architecture by consolidating metadata management within Kafka itself, making it more streamlined and efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a-pElB7EmAcWSYmY.jpg" /><figcaption>from confulent.io</figcaption></figure><h4>Let’s Get Started</h4><p>Here’s how you can set up Apache Kafka quickly using Docker</p><p><strong>1. Pull and Run the Kafka Docker Image:</strong> Open your terminal and run the following command:</p><pre>docker run -d -p 9092:9092 --name broker apache/kafka:latest</pre><p>This command pulls the latest Kafka image from Docker Hub and starts a container named broker.</p><p><strong>2. Verify Kafka is Running:</strong> Open your Docker dashboard. You’ll see a container named “<strong>broker</strong>” up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5s3DCuF2Hg4GzUPPz5GvBQ.png" /></figure><p><strong>3. Access the Kafka Shell:</strong> To interact with Kafka, open a shell inside the container:</p><pre>docker exec --workdir /opt/kafka/bin/ -it broker sh</pre><p><strong>4. Create a Topic</strong> A topic in Kafka is a logical grouping of events. Inside the container shell, create a topic named test-topic:</p><pre>./kafka-topics.sh --bootstrap-server localhost:9092 --create --topic test-topic</pre><p><strong>5. Produce Events</strong> Use the console producer to write events to the test-topic:</p><pre>./kafka-console-producer.sh --bootstrap-server localhost:9092 --topic test-topic</pre><p>At the &gt; prompt, enter the following:</p><pre>hello <br>world</pre><p>Press Ctrl+C to exit the producer.</p><p>6. <strong>Consume Events</strong> Read the events from the test-topic using the console consumer:</p><pre>./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test-topic --from-beginning</pre><p>You should see the events you produced earlier:</p><pre>hello<br>world</pre><h4>Congratulations!</h4><p>Your Apache Kafka setup is now complete and ready to use. 🚀</p><p>With KRaft mode and Docker, setting up Kafka has never been easier. Dive into Kafka’s powerful event-streaming capabilities and start building your applications today!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf42967f10fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Boot + RabbitMQ + Simple Java Mail — A Complete Beginner Guide]]></title>
            <link>https://santhosh-s.medium.com/spring-boot-rabbitmq-simple-java-mail-a-complete-beginner-guide-981d301a4d35?source=rss-2a1266d0709------2</link>
            <guid isPermaLink="false">https://medium.com/p/981d301a4d35</guid>
            <dc:creator><![CDATA[Santhosh]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 09:37:01 GMT</pubDate>
            <atom:updated>2024-12-27T09:37:01.886Z</atom:updated>
            <content:encoded><![CDATA[<h3>Spring Boot + RabbitMQ + Simple Java Mail — A Complete Beginner Guide</h3><figure><img alt="emails in queue" src="https://cdn-images-1.medium.com/max/1024/0*Ok_8pO4h50wgVJzC.jpg" /><figcaption>Image from aureatelabs.com</figcaption></figure><p>Hello Java Folks!</p><p>Are you looking to integrate <strong>messaging</strong> and <strong>email capabilities</strong> into your Spring Boot application? This guide is tailored for you! We’ll walk through setting up <strong>RabbitMQ</strong> for messaging and <strong>Simple Java Mail</strong> library for sending emails.</p><p>By the end, you’ll have a working application that can handle messaging and email notifications seamlessly.</p><h4>Why RabbitMQ and Simple Java Mail?</h4><ul><li><strong>RabbitMQ</strong>: A robust message broker that supports various messaging patterns, making it ideal for decoupled and scalable applications.</li><li><a href="https://www.simplejavamail.org/"><strong>Simple Java Mail</strong></a>: A user-friendly library for sending emails with minimal configuration.</li></ul><p>Let’s dive into the step-by-step process of integrating these tools into a Spring Boot application.</p><h4>Prerequisites</h4><ol><li><strong>Java 17+</strong>: Ensure you have Java installed on your system.</li><li><strong>Maven/Gradle</strong>: A build tool to manage dependencies.</li><li><strong>RabbitMQ Server</strong>: Install and run RabbitMQ locally using Docker or use a cloud-based RabbitMQ service.</li><li><strong>MailHog</strong>: Install and run MailHog locally using Docker to test emails.</li></ol><h3>Setting Up the Spring Boot Project</h3><h4>Step 1: Create a Spring Boot Application</h4><p>Use <a href="https://start.spring.io/">Spring Initializr</a> to generate a Spring Boot project with following dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CNm1QLoVtB9ZL9P6ENIr5A.png" /></figure><h4>Step 2: Add Simple Java Mail Dependency</h4><p>For Maven, update your pom.xml:</p><pre>&lt;dependency&gt;<br>   &lt;groupId&gt;org.simplejavamail&lt;/groupId&gt;<br>   &lt;artifactId&gt;simple-java-mail&lt;/artifactId&gt;<br>   &lt;version&gt;8.12.4&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>For Gradle, update your build.gradle:</p><pre>dependencies {<br>    implementation &#39;org.simplejavamail:simple-java-mail:8.12.4&#39;<br>}</pre><h3>Configuring RabbitMQ</h3><h4>Step 1: RabbitMQ Configuration</h4><p>Add the following properties to your application.properties or application.yml:</p><pre>spring:<br>  rabbitmq:<br>    host: localhost<br>    port: 5672<br>    username: guest<br>    password: guest</pre><h4>Step 2: Define a Message Queue</h4><p>Create a configuration class for RabbitMQ to create a queue and convert messages to JSON to store in the queue.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8ce8090b2bac679de5f02bc585300d2/href">https://medium.com/media/f8ce8090b2bac679de5f02bc585300d2/href</a></iframe><h3>Sending Emails with Simple Java Mail and Thymeleaf</h3><h4>Step 1: Create an HTML Email Template</h4><p>Create a Thymeleaf template in the src/main/resources/templates/email-templates directory. For example, test.html:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html xmlns:th=&quot;http://www.thymeleaf.org&quot;&gt;<br>  &lt;p&gt;Hello &lt;b th:text=&quot;${fullName}&quot;&gt;&lt;/b&gt;!&lt;/p&gt;<br>  &lt;p&gt;This is a test email from Spring boot!&lt;/p&gt;<br>&lt;/html&gt;</pre><h4>Step 2: Create an Email Service</h4><p>Create an EmailService class which is responsible to build the the HTML content using Thymeleaf template engine with dynamic context and send email using Simple Java Mail API to local Mailhog server.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9704509dea1b61fa1d9c6a889f63f142/href">https://medium.com/media/9704509dea1b61fa1d9c6a889f63f142/href</a></iframe><h3>Bringing It All Together</h3><h4>Step 1: Create a Consumer for Email Messages</h4><p>Create an EmailConsumer class to consume the message from queue and call the Email Service to send emails.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da310783cb502a3f9ac834c7b484fef7/href">https://medium.com/media/da310783cb502a3f9ac834c7b484fef7/href</a></iframe><h4>Step 2: Create a Producer for Email Messages</h4><p>Create an Email Producer class to create and send theEmail Message to the RabbitMQ queue.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aedc1f13080eac2e848df57b722a7111/href">https://medium.com/media/aedc1f13080eac2e848df57b722a7111/href</a></iframe><h4>Step 3: Create a Rest Controller for Sending Emails</h4><p>Finally, create a Rest API Controller class to trigger the functionality of adding a message to the queue to send emails.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f17b810a09119c639f2e9a7e6d7e69d2/href">https://medium.com/media/f17b810a09119c639f2e9a7e6d7e69d2/href</a></iframe><h3>Testing the Application</h3><ol><li>Run the Spring Boot application.</li><li>Start MailHog and access its web interface at http://localhost:8025</li><li>Make a POST request to endpoint: http://localhost:3000/api/email</li><li>Check MailHog to see the email sent.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pwh5kw0-nrRDs4ep9cKpNQ.png" /></figure><h3><strong>Conclusion</strong></h3><p>Congratulations! You’ve built a robust application integrating RabbitMQ for messaging, Thymeleaf for HTML templates, and Simple Java Mail for email delivery, all tested locally with MailHog.</p><p>Further you can add support for dynamic email APIs, custom templates, and a retry mechanism for RabbitMQ. Expand on this foundation to meet your application’s specific needs.</p><p>Thanks for reading! ️️Checkout this <a href="https://github.com/Santhosh136/spring-rabbit-mailer">repo</a> for the complete code.. Happy coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=981d301a4d35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get ready for some *pointer things!]]></title>
            <link>https://santhosh-s.medium.com/get-ready-for-some-pointer-things-1262828e9a3b?source=rss-2a1266d0709------2</link>
            <guid isPermaLink="false">https://medium.com/p/1262828e9a3b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[pointers]]></category>
            <dc:creator><![CDATA[Santhosh]]></dc:creator>
            <pubDate>Sun, 05 Jan 2020 18:29:34 GMT</pubDate>
            <atom:updated>2020-01-05T18:29:34.364Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello folks! get ready to learn some coolest things about one of the specific features of <strong>C</strong> language…that’s <strong><em>pointers. </em></strong><em>(Don’t forget to read the </em><strong><em>bonus</em></strong><em> point at the end!)</em></p><figure><img alt="Pointers" src="https://cdn-images-1.medium.com/max/855/1*jSnjw7NAVMD6grDQvUpkvg.jpeg" /></figure><h3>1) Array’s name vs Pointer:</h3><p>We know that, <strong><em>arrays</em></strong> are built-in datastructures, used for storing <strong><em>fixed number</em></strong> of elements in a contigous fashion.</p><p>You know one thing? Array’s name is actually a pointer to the first element of an array. Which means, the base address of the array, is pointed by the name of the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*wPC5w12GVFpcfv5u5jyXnw.jpeg" /><figcaption>array name pointing to the first element</figcaption></figure><p>In the above example, 1000 is the base address of an array <strong>a </strong>, which is being pointed by the name of the array. We can also <strong><em>dereference</em></strong> or modify the value stored in that location by using <strong>*</strong> operator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*xUL1Ctr4_xYFbiAY-mLwAA.jpeg" /><figcaption>dereferencing the value</figcaption></figure><p>We know, adding an integer moves the pointer to next location. As in the same way, adding 2 to the base address of the array ( since, it is a pointer ), moves it to 2nd index of the array.</p><p>Following picture depicts the operation…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*ANETOWEZywgVqaOk9RCp5A.jpeg" /><figcaption>pointer addition</figcaption></figure><p>Generally, it can be calculated as follows, <strong>&amp;a[i] = (1000) + (i x 4).</strong></p><h3>2) Can we compare pointers ?</h3><p>The answer is <strong>YES</strong>. Same as comparing int, char, strings, etc., we can also compare pointers using <strong>comparison operators</strong> like &lt; , &lt;= , &gt; , &gt;=, ==, !=. Here, the comparison is based on the <strong>relative poistion</strong> of the pointers.</p><p><strong><em>Note:</em></strong><em> While comparing pointers, both the pointers should points to the same array, otherwise it throws an error.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*6qmwHsZKdOtE6SmD8FP4xA.jpeg" /><figcaption>comparison of pointers</figcaption></figure><p>In the above example, the pointer <strong>p </strong>is pointing to the first element and <strong>q</strong> is pointing to the fourth element. Hence, p &lt; q returns 1(true), p&gt;q and p==q returns 0(false).</p><h3>3) Are we passing strings literals ?</h3><p>While using printf() and scanf() functions, we are passing strings literals. But actually, that’s not true. Both printf() and scanf() expects <strong>char*</strong> as an argument. Are we passing the whole string to those functions?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*XLMULYzDfJjosPi6hl99Kw.jpeg" /><figcaption>pointer to the first character of a string</figcaption></figure><p>The answer is <strong>NO</strong>. We are passing only the pointer to the first character of the string. We know that strings are terminated by a null character ‘\0’, these fuctions traverse the strings until it reaches the null character and prints them on the screen.</p><h3>Here comes the BONUS point!</h3><p>Here is a tip for<strong> initializing</strong> the array elements. More often, we use for loops to assing values to the elements of an array. By using designated initialization, we can simply do this in a single line!</p><ul><li>for initializing all the elements with zero..</li></ul><p><strong>int</strong> a[ 100 ] = { 0 };</p><ul><li>to initialize particular values at a particular indices…</li></ul><p><strong>int</strong> a[10] = { [1] = 10, [5] =50, [8] = 80 };</p><p>In the above line, except 1,5 and 8 index positions, all the other positions are automatically set to 0.</p><ul><li>To initialize a range of values..</li></ul><p><strong>int</strong> a[ 50 ] = { [ 0…24] =10, [25…49] = 20 };</p><p>In the above statement, first 25 elements are assigned with 10 and then the next 25 are assinged with 20. That’s all.</p><h4>Hope you’ve learned something ;-)</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1262828e9a3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ 5 Strange things that you haven’t heard in C]]></title>
            <link>https://santhosh-s.medium.com/5-strange-things-that-you-havent-heard-in-c-f406071e80d5?source=rss-2a1266d0709------2</link>
            <guid isPermaLink="false">https://medium.com/p/f406071e80d5</guid>
            <category><![CDATA[c-programming]]></category>
            <category><![CDATA[interesting-facts]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Santhosh]]></dc:creator>
            <pubDate>Sun, 06 Oct 2019 12:25:04 GMT</pubDate>
            <atom:updated>2019-10-26T14:22:07.067Z</atom:updated>
            <content:encoded><![CDATA[<h3>😉 5 Strange things that you haven’t heard in C</h3><p>Hi there!🤩 We all know, C is a general-purpose programming language that is extremely popular, simple and flexible. In this articel we are going to reveal some strange areas of C language…</p><figure><img alt="C language" src="https://cdn-images-1.medium.com/max/596/1*E6XFftZQI4_3VIammdxD-g.jpeg" /></figure><h4>1. The case label of Switch statement can occur inside if-else statements.</h4><p>We know that switch-case statement is useful when we have multiple options. Once the case match is found, a block of statements associated with that particular case is executed. Do you know one thing? we can use the case label inside the if-else statement. Here goes the example with output…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*UfqfzSbbGUTOXyWpfKznXA.png" /></figure><p>🤔 <strong><em>what’s the reason?</em></strong><em> when the control comes to switch statement it will redirects the control to matching case. Here,the option is 2 so it will redirects the control to case 2 and it’s inside the if statement ,so once the if block is executed (else block will not be executed) it will come out of the scope of switch-case statement.</em></p><h4>2.array[index] is same as index[array]</h4><p>Arrays are data structures used for storing a collection data values of same type in contiguous fashion. Normally we can access array elements by the index value as <em>array[index] . </em>In the same way, we can also use it as follows…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*-qdpiYS4bKTvZ7sYYt9amw.png" /></figure><p>🤔<strong><em> what’s the reason?</em></strong><em> The reason for this to work is, array elements are accessed using pointer arithmetic. Here i[a] is equivalent to *(a+i) ,since </em><strong><em>a </em></strong><em>stores the base address of an array we can access them using pointer arithmetic.</em></p><h4>3. Ignoring inputs in scanf()</h4><p>We can ignore the inputs taken by scanf() function as follows…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*FGAjxa5C1wJVItLd5v7_AA.png" /></figure><p>🤔 <strong><em>what is the reason?</em></strong><em> The reason behind this is, the asterisk </em><strong><em>* </em></strong><em>here denotes the value of width field dynamically. So it will be omitted and the immediate next format specifier will executed. For more info </em><a href="https://en.wikipedia.org/wiki/Printf_format_string"><em>check this</em></a><em>.</em></p><h4>4.You can use #include here !</h4><p>Commonly the structure of the C program specifies the Header section where we can include the header files using the <strong>preprocessor directive</strong> <em>#include.</em> We can also use it like this….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*V3dS618GSLhLEd_WdTMDAw.png" /></figure><p>🤔 <strong><em>what is the reason?</em></strong><em> When the compiler compiles the program it will invoke a special program called </em><strong><em>preprocessor. </em></strong><em>Then the preprocessor process the lines starts with # in the program, and copies the contents to our file. Here, it copies the content of </em><strong><em>“a.txt” </em></strong><em>file to our program hence it prints “Hello Guys!!!”.</em></p><h4>5. Heard of goes to operator ( --&gt;) ?</h4><p>Have you ever had of goes to (--&gt;)operator, which starts from large value and goes towards a specific small value ? Take a look in the below snippet…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*eXRhDKtK3QIBQuW6Jp5Z0Q.png" /></figure><p>🤔 <strong><em>what is the reason?</em></strong><em> In-fact there is no operator like </em><strong><em>goes to </em></strong><em>in C language </em>😋 <em>It is a combination of two operators post-decrement(--) and greater than (&gt;) operator. Initially a is decremented to 9 and the loop prints the value from 9 to 0.</em></p><p>Hope you’ve learned something 😇 Happy learning !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f406071e80d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>