<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Souvik Kundu</title>
    <description>The latest articles on DEV Community by Souvik Kundu (@souvikkundu).</description>
    <link>https://dev.to/souvikkundu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F190842%2F3b57cae0-18ec-4a1a-b1da-97a86628ce8b.jpg</url>
      <title>DEV Community: Souvik Kundu</title>
      <link>https://dev.to/souvikkundu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/souvikkundu"/>
    <language>en</language>
    <item>
      <title>Do Not Memorize C Keywords. There Is A Smart Way To Learn Them.</title>
      <dc:creator>Souvik Kundu</dc:creator>
      <pubDate>Tue, 21 Oct 2025 14:24:02 +0000</pubDate>
      <link>https://dev.to/souvikkundu/do-not-memorize-c-keywords-there-is-a-smart-way-to-learn-them-1hcn</link>
      <guid>https://dev.to/souvikkundu/do-not-memorize-c-keywords-there-is-a-smart-way-to-learn-them-1hcn</guid>
      <description>&lt;p&gt;If you’re learning C programming, you’ve probably seen the giant list of reserved keywords, words you can’t use as variable names because they’re already part of the language.&lt;br&gt;
And if you’ve ever tried to memorize them all, you know how painful, and pointless it feels.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don’t Memorize, Understand and Group&lt;/strong&gt;&lt;br&gt;
You don’t need to memorize keywords like a dictionary.&lt;br&gt;
Instead, your brain learns better when you group and understand them in context. C keywords fall naturally into categories, and once you see the pattern, you’ll remember them automatically.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Data Type Keywords&lt;/strong&gt;&lt;br&gt;
Used to define what kind of data a variable holds.&lt;br&gt;
 Examples: int, float, double, char, short, long, void, signed, unsigned&lt;br&gt;
 Think: “I define what kind of box I’m using before I put something in it.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Storage Class Keywords&lt;/strong&gt;&lt;br&gt;
They control where and how long a variable exists in memory.&lt;br&gt;
 Examples: auto, static, extern, register&lt;br&gt;
 Think: “Where does my box live, and when does it disappear?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Type Qualifiers &amp;amp; Modifiers&lt;/strong&gt;&lt;br&gt;
They modify how variables behave or are accessed.&lt;br&gt;
 Examples: const, volatile, restrict, inline&lt;br&gt;
Think: “Add rules to how my box can be used, read-only, change anytime, etc.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Control Flow Keywords&lt;/strong&gt;&lt;br&gt;
These decide what happens next in your program.&lt;br&gt;
 Examples: if, else, switch, case, default, for, while, do, break, continue, goto, return&lt;br&gt;
Think: “These are my decision-makers and loop controllers.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Data Structuring Keywords&lt;/strong&gt;&lt;br&gt;
Used to build complex, custom data types.&lt;br&gt;
 Examples: struct, union, enum, typedef&lt;br&gt;
Think: “Blueprints for building your own data structures.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Modern &amp;amp; Advanced Keywords (C99, C11)&lt;/strong&gt;&lt;br&gt;
These are advanced tools for multithreading, atomic operations, generics, etc.&lt;br&gt;
 Examples: _Bool, _Complex, _Imaginary, _Atomic, _Generic, _Static_assert, _Thread_local, _Alignas, _Alignof, _Noreturn&lt;br&gt;
Think: “Power tools, not for beginners, but good to know they exist.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learn by Usage, Not by List&lt;/strong&gt;&lt;br&gt;
When you learn loops, work with data types, and write functions, each keyword becomes memorable when you use it.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>c</category>
    </item>
    <item>
      <title>C Programming: A Short and Simple Guide To break, continue, and switch</title>
      <dc:creator>Souvik Kundu</dc:creator>
      <pubDate>Thu, 31 Oct 2024 13:02:59 +0000</pubDate>
      <link>https://dev.to/souvikkundu/c-programming-a-short-and-simple-guide-to-break-continue-and-switch-ain</link>
      <guid>https://dev.to/souvikkundu/c-programming-a-short-and-simple-guide-to-break-continue-and-switch-ain</guid>
      <description>&lt;p&gt;This quick and simple post delves into more advanced control flow mechanisms in C, providing programmers with the tools to write more efficient and readable code.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;break&lt;/strong&gt; and &lt;strong&gt;continue&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;These keywords allow us to manipulate loop execution.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;break&lt;/strong&gt;: Terminates the loop entirely.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (int i = 0; i &amp;lt; 10; i++) {
  if (i == 5) {
    break; 
  }
  printf("%d ", i);
}
// Output: 0 1 2 3 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;continue&lt;/strong&gt;: Skips the current iteration and proceeds to the next.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (int i = 0; i &amp;lt; 5; i++) {
  if (i == 2) {
    continue; 
  }
  printf("%d ", i);
}
// Output: 0 1 3 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;switch&lt;/strong&gt;: A cleaner alternative to multiple if-else statements when dealing with a single variable.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int day = 3;
switch (day) {
  case 1:
    printf("Monday\n");
    break;
  case 2:
    printf("Tuesday\n");
    break;
  case 3:
    printf("Wednesday\n");
    break;
  default:
    printf("Other day\n");
}
// Output: Wednesday
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;break&lt;/strong&gt; statements are crucial in switch blocks to prevent fall-through behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conditional Operator (?:)&lt;/strong&gt;&lt;br&gt;
A concise way to express simple conditional logic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 10, b = 20;
int max = (a &amp;gt; b) ? a : b; // max will be 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is equivalent to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 10, b = 20;
int max;
if (a &amp;gt; b) {
  max = a;
} else {
  max = b;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;conditional operator (?:)&lt;/strong&gt; enhances code readability when used appropriately.&lt;/p&gt;

&lt;p&gt;C programmers can write organized, efficient, and maintainable code by mastering control flow mechanisms. These constructs allow for flexible program execution.&lt;/p&gt;

</description>
      <category>c</category>
    </item>
    <item>
      <title>Loops in C: A Simple Guide with Examples</title>
      <dc:creator>Souvik Kundu</dc:creator>
      <pubDate>Thu, 31 Oct 2024 10:38:37 +0000</pubDate>
      <link>https://dev.to/souvikkundu/loops-in-c-a-simple-guide-with-examples-5hi7</link>
      <guid>https://dev.to/souvikkundu/loops-in-c-a-simple-guide-with-examples-5hi7</guid>
      <description>&lt;p&gt;Loops are essential tools in programming that allow us to execute a block of code repeatedly. They can perform a variety of tasks, from simple calculations to complex data processing.&lt;/p&gt;

&lt;p&gt;In C programming, we have three main types of loops: &lt;strong&gt;for&lt;/strong&gt;, &lt;strong&gt;while&lt;/strong&gt;, and &lt;strong&gt;do-while&lt;/strong&gt;. Let's explore each of them with examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  The &lt;em&gt;for&lt;/em&gt; Loop
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;for&lt;/em&gt; loop is the default choice when we know exactly how many times we want to repeat a block of code. It's like setting a timer for our code to run a specific number of times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// syntax

for (initialization; condition; increment/decrement) {
  // Code to be executed in each iteration
}

// example

#include &amp;lt;stdio.h&amp;gt;

int main() {
  for (int i = 1; i &amp;lt;= 5; i++) {
    printf("%d ", i);
  }
  printf("\n"); // Output: 1 2 3 4 5
  return 0;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the for loop prints the numbers from &lt;em&gt;1 to 5&lt;/em&gt; . The initialization ( &lt;em&gt;int i = 1;&lt;/em&gt; ) sets the starting value of the counter variable &lt;em&gt;i&lt;/em&gt; . The condition ( &lt;em&gt;i &amp;lt;= 5;&lt;/em&gt; ) specifies that the loop should continue as long as &lt;em&gt;i is less than or equal to 5&lt;/em&gt; . The increment ( &lt;em&gt;i++&lt;/em&gt;  ) increases the value of &lt;em&gt;i&lt;/em&gt;  &lt;em&gt;by 1&lt;/em&gt;  after each iteration.&lt;/p&gt;

&lt;h3&gt;
  
  
  The &lt;em&gt;while&lt;/em&gt; Loop
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;while&lt;/em&gt; loop is like a conditional loop. It keeps spinning (executing the code block) as long as the condition remains true.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// syntax
while (condition) {
  // Code to be executed repeatedly
}

// example
#include &amp;lt;stdio.h&amp;gt;

int main() {
  int i = 1;
  while (i &amp;lt;= 5) {
    printf("%d ", i);
    i++;
  }
  printf("\n"); // Output: 1 2 3 4 5
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This &lt;em&gt;while&lt;/em&gt; loop achieves the same result as the &lt;em&gt;for&lt;/em&gt; loop above. It prints the numbers from &lt;em&gt;1 to 5&lt;/em&gt; , but the counter variable &lt;em&gt;i&lt;/em&gt; is initialized and incremented outside the loop structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  The &lt;em&gt;do-while&lt;/em&gt; Loop
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;do-while&lt;/em&gt; loop insists on executing the code block at least once, even if the condition is initially false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// syntax
do {
  // Code to be executed repeatedly
} while (condition);

// example
#include &amp;lt;stdio.h&amp;gt;

int main() {
  int i = 6; // Notice i is initialized to 6
  do {
    printf("%d ", i);
    i++;
  } while (i &amp;lt;= 5);
  printf("\n"); // Output: 6
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even though the condition &lt;em&gt;i &amp;lt;= 5&lt;/em&gt;  is false from the start, the &lt;em&gt;do-while&lt;/em&gt; loop still executes the code block once, printing the value of &lt;em&gt;i  (which is 6)&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Applications of Loops
&lt;/h3&gt;

&lt;p&gt;Loops are incredibly versatile and have a wide range of applications in programming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeating tasks:  Automating repetitive actions like printing a series of numbers, processing data in an array, or reading input from the user until a specific condition is met.&lt;/li&gt;
&lt;li&gt;Iterating through data structures: Accessing and manipulating elements in arrays, lists, or other data structures.&lt;/li&gt;
&lt;li&gt;Implementing algorithms:  Loops are fundamental building blocks in many algorithms, such as sorting, searching, and graph traversal.&lt;/li&gt;
&lt;li&gt;Creating simulations and games:  Simulating real-world scenarios or creating game logic that involves repetitive actions or events. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lastly, since loops are fundamental in programming, understanding them in C will prepare you to learn other languages like Python, JavaScript, and Java.&lt;/p&gt;

</description>
      <category>c</category>
    </item>
    <item>
      <title>Float vs. Double in Java: Choosing the Right Tool for the Job</title>
      <dc:creator>Souvik Kundu</dc:creator>
      <pubDate>Thu, 31 Oct 2024 08:46:34 +0000</pubDate>
      <link>https://dev.to/souvikkundu/float-vs-double-in-java-choosing-the-right-tool-for-the-job-4c9g</link>
      <guid>https://dev.to/souvikkundu/float-vs-double-in-java-choosing-the-right-tool-for-the-job-4c9g</guid>
      <description>&lt;p&gt;When working with decimal numbers in Java, you have two main options: &lt;em&gt;float&lt;/em&gt; and &lt;em&gt;double&lt;/em&gt;. While both represent floating-point values, they differ in precision, memory usage, and ideal use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Differences
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Precision:  Float offers approximately 7 decimal digits of precision, while double provides around 15 decimal digits.&lt;/li&gt;
&lt;li&gt;Memory Usage: Float takes up 4 bytes of memory, while double occupies 8 bytes.&lt;/li&gt;
&lt;li&gt;Speed:  Float calculations are slightly faster than double, but this difference is often negligible on modern hardware.&lt;/li&gt;
&lt;li&gt;Range of Values: Double can represent a much wider range of values than float.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Use &lt;em&gt;float&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Choose float when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory is a Concern: If you're dealing with a large amount of floating-point data (e.g., in scientific simulations or 3D graphics), using float can save significant memory.&lt;/li&gt;
&lt;li&gt;Precision Isn't Critical: When you don't need extreme accuracy, float is often sufficient. Use it for representing pixel coordinates in graphics, approximate measurements in simulations, or temperatures where minor rounding errors are acceptable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of &lt;em&gt;float&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;float temperatureCelsius = 25.5f;  
float gravityMetersPerSecondSquared = 9.8f;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  When to Use &lt;em&gt;double&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Choose double when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Precision Matters: For calculations where accuracy is paramount, double is the way to go. It's suitable for financial calculations, scientific simulations requiring high precision, and any situation where rounding errors can lead to significant problems.&lt;/li&gt;
&lt;li&gt;Large Range of Values: If you need to represent extremely large or small numbers, double offers a wider range than float.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of &lt;em&gt;double&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;double pi = 3.14159265358979323846;  
double avogadrosNumber = 6.02214076e23;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rule of Thumb
&lt;/h3&gt;

&lt;p&gt;If you're unsure, err on the side of using double. Its increased precision and range will often be more beneficial than the slight memory savings offered by float.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaway:&lt;/strong&gt;&lt;br&gt;
The choice between float and double boils down to balancing precision and memory usage. By understanding their strengths and weaknesses, you can make informed decisions for your specific applications.&lt;/p&gt;

</description>
      <category>java</category>
    </item>
  </channel>
</rss>
