<?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: James</title>
    <description>The latest articles on DEV Community by James (@snjjay).</description>
    <link>https://dev.to/snjjay</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%2F347517%2Fd44aa964-3288-424b-bad2-86cc2ece4662.png</url>
      <title>DEV Community: James</title>
      <link>https://dev.to/snjjay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/snjjay"/>
    <language>en</language>
    <item>
      <title>How to get the ASCII value of a character in C++?</title>
      <dc:creator>James</dc:creator>
      <pubDate>Tue, 18 Jan 2022 13:20:21 +0000</pubDate>
      <link>https://dev.to/snjjay/how-to-get-the-ascii-value-of-a-character-in-c-36mm</link>
      <guid>https://dev.to/snjjay/how-to-get-the-ascii-value-of-a-character-in-c-36mm</guid>
      <description>&lt;p&gt;Have you ever wondered how does the computer understands what key we have pressed on the keyboard? The computer cannot understand the human language i.e. English or any other language. It just understands the numerical language, so every character on the keyboard has a numerical code behind it which is called ASCII code. In this article, we are going to see how to find the ASCII code of a character in C++ but before that, let’s see what an ASCII code is. &lt;/p&gt;

&lt;p&gt;ASCII Code:&lt;br&gt;
ASCII stands for American Standard Code for Information Interchange. It is an encoding standard for electronic communication and represents text in computers and other electronic devices. This code is used to represent information in computers as computers can only understand the numerical language. Whenever you press a key on the keyboard, the ASCII code associated with that key is sent to the CPU which is then converted to the binary representation, and operations are performed on it.&lt;/p&gt;

&lt;p&gt;Now that we understand what an ASCII code is, let’s move to the program to find the ASCII code of a character in C++:&lt;/p&gt;

&lt;p&gt;Find ASCII Value of a Character in C++:&lt;br&gt;
To find the ASCII value of a character, we just need to convert the character to an integer using explicit typecasting. Type Casting refers to converting one type of data to another. The syntax for converting a character to an integer is as follows:&lt;/p&gt;

&lt;p&gt;int variable = (int)character;&lt;br&gt;
Program:&lt;/p&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;using namespace std;&lt;/p&gt;

&lt;p&gt;int main()&lt;br&gt;
{&lt;br&gt;
    char ch = 'a';&lt;br&gt;
    int ASCII = (int)ch;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cout&amp;lt;&amp;lt;"Character: "&amp;lt;&amp;lt;ch&amp;lt;&amp;lt;endl&amp;lt;&amp;lt;"ASCII Code: "&amp;lt;&amp;lt;ASCII;

return 0;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
Output:&lt;/p&gt;

&lt;p&gt;Character: a&lt;br&gt;
ASCII Code: 97&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--96SDa1Q2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9q5o5qijfnbhvcuo8qwo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--96SDa1Q2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9q5o5qijfnbhvcuo8qwo.jpg" alt="Image description" width="500" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>ascii</category>
    </item>
    <item>
      <title>What is encapsulation in C++?</title>
      <dc:creator>James</dc:creator>
      <pubDate>Thu, 19 Nov 2020 09:33:40 +0000</pubDate>
      <link>https://dev.to/snjjay/what-is-encapsulation-in-c-1037</link>
      <guid>https://dev.to/snjjay/what-is-encapsulation-in-c-1037</guid>
      <description>&lt;p&gt;What is encapsulation in C++?&lt;br&gt;
Encapsulation in C++ means binding of data with the functions that performs actions on that data. Encapsulation keeps us safe from outside interference and misuse. And that led us to the important concept of OOP which is data hiding. Encapsulation is used to hide the values or state of a structured data object inside a class, preventing the interference with them.&lt;/p&gt;

&lt;p&gt;Data hiding&lt;br&gt;
Data hiding is also a concept of Object Oriented Programming (OOP) that hides details of internal objects. &lt;br&gt;
The belief behind data hiding is to conceal data within a class, so it can be prevented or protected to be accessed by the outside class. Data hiding helps us to create classes with unique data sets and functions by avoiding unnecessary penetration from other program classes.&lt;br&gt;
There is a slight difference between data hiding and data encapsulation, data hiding hides only class data elements, whereas data encapsulation hides class data parts and private functions/methods.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Null reference error</title>
      <dc:creator>James</dc:creator>
      <pubDate>Sun, 08 Mar 2020 01:04:41 +0000</pubDate>
      <link>https://dev.to/snjjay/null-reference-error-9f0</link>
      <guid>https://dev.to/snjjay/null-reference-error-9f0</guid>
      <description>&lt;p&gt;How to remove null reference error&lt;/p&gt;

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