<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Built in data tyepe | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/built-in-data-tyepe/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 04:46:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ Data Types &#038; Constants</title>
		<link>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-data-types-constants/</link>
					<comments>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-data-types-constants/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Fri, 09 Dec 2022 07:43:00 +0000</pubDate>
				<category><![CDATA[C++ Tutorials]]></category>
		<category><![CDATA[C++ data type]]></category>
		<category><![CDATA[Built in data tyepe]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9825</guid>

					<description><![CDATA[<p>Data Types in C++ Data types specify the kinds of data that a variable can store; for instance, an integer variable can store data of that kind, a character variable can store data of that type, etc. In C++, there are three categories for data types: Built-in data types These pre-defined data types for a</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-data-types-constants/">C++ Data Types & Constants</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>Data Types in C++</strong></p>



<p>Data types specify the kinds of data that a variable can store; for instance, an integer variable can store data of that kind, a character variable can store data of that type, etc.</p>



<p>In C++, there are three categories for data types:</p>



<p><strong>Built-in data types</strong></p>



<p>These pre-defined data types for a language could be used right away by the programmer.</p>



<p>Int, Float, Char, Double, and Boolean are a few examples.</p>



<p><strong>User-defined data types</strong></p>



<p>The user itself defines these data kinds. Class, Struct, Union, and Enum are some examples.</p>



<p><strong>Derived data Type</strong></p>



<p>The basic built-in data types are the ancestors of these data types.</p>



<p>Array, Pointer, and Function are some examples.</p>



<p>Some of the popular built-in data types and their applications are:</p>



<figure class="wp-block-table"><table><tbody><tr><td>Data Type</td><td>Size</td><td>Description</td></tr><tr><td>int</td><td>2 or 4 bytes</td><td>Stores whole numbers, without decimals</td></tr><tr><td>float</td><td>4 bytes</td><td>Stores fractional numbers, containing one or more decimals. They require 4 bytes of memory space.</td></tr><tr><td>double</td><td>8 bytes</td><td>Stores fractional numbers, containing one or more decimals. They require 4 bytes of memory space.</td></tr><tr><td>char</td><td>1 byte</td><td>Stores a single character/letter/number, or ASCII values</td></tr><tr><td>boolean</td><td>1 byte</td><td>Stores true or false values</td></tr></tbody></table></figure>



<p><strong>Constants in C++</strong></p>



<p>Constants are immutable; once they are initialised in a program, a constant variable&#8217;s value cannot be changed.</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream&gt;
using namespace std;
 
int main()
{
    const float PI = 3.14;
    cout &lt;&lt; "The value of PI is " &lt;&lt; PI &lt;&lt; endl;
    PI = 3.00; //error, since changing a const variable is not allowed.
}
</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">error: assignment of read-only variable 'PI'</code></pre><p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-data-types-constants/">C++ Data Types & Constants</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-data-types-constants/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
