<?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: Bittu Kumar</title>
    <description>The latest articles on DEV Community by Bittu Kumar (@bittu-kumar02).</description>
    <link>https://dev.to/bittu-kumar02</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%2F2001983%2F29db77d5-de8d-47c8-b060-2845dff99256.png</url>
      <title>DEV Community: Bittu Kumar</title>
      <link>https://dev.to/bittu-kumar02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bittu-kumar02"/>
    <language>en</language>
    <item>
      <title>ESCAPE SEQUENCES IN C</title>
      <dc:creator>Bittu Kumar</dc:creator>
      <pubDate>Fri, 30 Aug 2024 08:47:23 +0000</pubDate>
      <link>https://dev.to/bittu-kumar02/escape-2k62</link>
      <guid>https://dev.to/bittu-kumar02/escape-2k62</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hello everyone, This is my 1st post on dev.to in which I would like to tell you about ESCAPE SEQUENCES IN C...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In C, escape sequences are special character sequences that represent characters which cannot be easily typed or are non-printable. Here’s a brief overview of some common escape sequences and an example demonstrating their usage:-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LIST OF COMMON ESCAPE SEQUENCES IN C&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;. \\ - Backslash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Represents a literal backslash.&lt;br&gt;
Example: printf("This is a backslash: \\");&lt;br&gt;
// Output: This ia a backslash: \&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.   \n - Newline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moves the cursor to the next line.&lt;br&gt;
Example: printf("Hello\nWorld");&lt;br&gt;
// Output:&lt;br&gt;
Hello&lt;br&gt;
World&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.   \t - Horizontal Tab&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moves the cursor to the next tab stop.&lt;br&gt;
Example: printf("Name   \tAge\nAlice   \t30"); &lt;br&gt;
// Output:&lt;br&gt;
Name    Age&lt;br&gt;
Alice   30&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.  \r - Carriage Return&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moves the cursor to the beginning of the current line.&lt;br&gt;
Example: printf("12345\rAB"); &lt;br&gt;
// Output: AB345&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.  \a - Alert (Bell)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Example: printf("Warning!\a");&lt;br&gt;
Output : Produces an audible bell sound (might not be heard on all systems).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.  \0 - Null Character&lt;/strong&gt;&lt;br&gt;
Marks the end of a string in C.&lt;br&gt;
Example: char str[] = "Hello\0World";&lt;br&gt;
Output : // Only "Hello" is printed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Code&lt;/strong&gt; - Here’s a concise example showing some of these escape sequences in action:-&lt;/p&gt;

&lt;p&gt;&lt;em&gt;int main() {&lt;br&gt;
    printf("This is a backslash: \ \n");&lt;br&gt;
    printf("This is on a new line.\n");&lt;br&gt;
    printf("Here is a tab:\tTabbed text.\n");&lt;br&gt;
    printf("Carriage return:\rOverwritten\n");&lt;br&gt;
    printf("Alert sound:\a\n");&lt;br&gt;
    printf("Null character example: Hello\0World\n")&lt;br&gt;
    return 0;&lt;br&gt;
}&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Explanation of Output&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;\: Outputs a single backslash.&lt;/li&gt;
&lt;li&gt;\n: Moves to the next line.&lt;/li&gt;
&lt;li&gt;\t: Inserts a tab space.&lt;/li&gt;
&lt;li&gt;\r: Overwrites the beginning of the current line with new text.&lt;/li&gt;
&lt;li&gt;\a: Triggers an alert sound (if supported).&lt;/li&gt;
&lt;li&gt;\0: Ends the string at "Hello", so "World" is not printed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Escape sequences are essential for formatting output and including special characters in strings in C programming.&lt;/p&gt;

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