<?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>constants and variables - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/constants-and-variables/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/constants-and-variables/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Fri, 07 Oct 2022 09:03:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>constants and variables - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/constants-and-variables/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is constant and variable in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-constant-and-variable-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-constant-and-variable-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 09:03:07 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c contstants]]></category>
		<category><![CDATA[c variables]]></category>
		<category><![CDATA[constants and literals]]></category>
		<category><![CDATA[constants and variables]]></category>
		<category><![CDATA[constants and variables in c]]></category>
		<category><![CDATA[constants vs variables in c language]]></category>
		<category><![CDATA[declare variable as constant in c]]></category>
		<category><![CDATA[difference between constant and variable in c]]></category>
		<category><![CDATA[difference between variables and constants in c]]></category>
		<category><![CDATA[non constant variable in c]]></category>
		<category><![CDATA[variable and constant in c]]></category>
		<category><![CDATA[variables and constants in c programming]]></category>
		<category><![CDATA[what is constant in c]]></category>
		<category><![CDATA[what is variable in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4977</guid>

					<description><![CDATA[Constant A constant is a value or identifier whose value is fixed and does not change, in the entire program. Constant is similar to a variable but it can hold only a single variable during the execution of program. Ex: const double PI = 3.14; Here, Const is a identifier Double is a data type [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id=""><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4978 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable.jpg" alt="" width="933" height="363" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable.jpg 933w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-300x117.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-768x299.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-390x152.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-820x319.jpg 820w" sizes="(max-width: 933px) 100vw, 933px" /></h2>
<h2 id="constant"><strong>Constant</strong></h2>
<ul>
<li>A constant is a value or identifier whose value is fixed and does not change, in the entire program.</li>
<li>Constant is similar to a variable but it can hold only a single variable during the execution of program.</li>
<li><strong>Ex: </strong><strong>const double PI = 3.14;</strong><br />
Here,</p>
<ul>
<li>Const is a identifier</li>
<li>Double is a data type</li>
<li>PI is a constant variable name that takes a value of 3.14.</li>
<li>This value of 3.14 does not change during the entire program.</li>
</ul>
</li>
</ul>
<h2 id="variable"><strong>Variable</strong></h2>
<ul>
<li>Variable is any characteristic, number, or quantity that can be measured or counted.</li>
<li>It is also called as data item.</li>
<li>A Variable is a name or an identifier that can store any values, and those values can be changed at any time during the program.</li>
<li>For example: <strong>int score = 6;</strong>
<ul>
<li>Here, score is a variable name of integer type that stores the value 6. The value of score can be changed any time during the program.</li>
</ul>
</li>
</ul>
<p><img decoding="async" class="alignnone size-full wp-image-4980 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1.jpg" alt="" width="580" height="320" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1.jpg 580w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1-300x166.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1-390x215.jpg 390w" sizes="(max-width: 580px) 100vw, 580px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-constant-and-variable-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What are the advantages and disadvantages of using inline and const ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/what-are-the-advantages-and-disadvantages-of-using-inline-and-const/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/what-are-the-advantages-and-disadvantages-of-using-inline-and-const/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 21:52:36 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[advantages and disadvantages of inline function in c++]]></category>
		<category><![CDATA[Advantages of const in C++ ?]]></category>
		<category><![CDATA[Advantages of inline functions - C++]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Benefits of inline functions in C++ ?]]></category>
		<category><![CDATA[Benefits of using const functions - C / C++]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[c const]]></category>
		<category><![CDATA[c const pointer]]></category>
		<category><![CDATA[c constant]]></category>
		<category><![CDATA[c inline]]></category>
		<category><![CDATA[c++ implicit inline]]></category>
		<category><![CDATA[c++ inline a variable]]></category>
		<category><![CDATA[c++ inline class]]></category>
		<category><![CDATA[c++ inline const variable]]></category>
		<category><![CDATA[c++ inline function declaration]]></category>
		<category><![CDATA[c++ inline global function]]></category>
		<category><![CDATA[c++ inline linkage]]></category>
		<category><![CDATA[c++ inline member function]]></category>
		<category><![CDATA[c++ inline variable]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Const Functions]]></category>
		<category><![CDATA[const pointer]]></category>
		<category><![CDATA[constants and variables]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Disadvantage]]></category>
		<category><![CDATA[eInfochips interview questions and answers]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Harman International interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Inline and const functions (C++)]]></category>
		<category><![CDATA[inline constexpr]]></category>
		<category><![CDATA[inline constexpr variable]]></category>
		<category><![CDATA[inline declaration c++]]></category>
		<category><![CDATA[inline definition]]></category>
		<category><![CDATA[inline function]]></category>
		<category><![CDATA[Inline function Advantages]]></category>
		<category><![CDATA[inline function in c]]></category>
		<category><![CDATA[Inline Functions in C++]]></category>
		<category><![CDATA[inline variable c#]]></category>
		<category><![CDATA[Larsen & Toubro interview questions and answers]]></category>
		<category><![CDATA[like virtual void Function()]]></category>
		<category><![CDATA[Mathworks India Private Limited interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Philips Software Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[SRM Technologies interview questions and answers]]></category>
		<category><![CDATA[static inline]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tecnotree interview questions and answers]]></category>
		<category><![CDATA[What are the advantages and disadvantages of inline function ?]]></category>
		<category><![CDATA[What are the advantages of using const ?]]></category>
		<category><![CDATA[what is inline function]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[Yash Technologies interview questions and answers]]></category>
		<category><![CDATA[zimmer biomet interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=353</guid>

					<description><![CDATA[Answers : Advantages of inline....]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="what-are-the-advantages-and-disadvantages-of-using-inline-and-const" class="color-pink" style="text-align: justify;">What are the advantages and disadvantages of using inline and const</h2>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="inline" class="color-green">Inline:</h2>
</div>
<p style="text-align: justify;"><b>Advantages:</b></p>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>It does not require function calling overhead.</li>
<li>It additionally save overhead of variables push/pop on the stack, while function calling.</li>
<li>It also save overhead of return call from a function.</li>
<li>It increases locality of reference by utilizing instruction cache.</li>
<li>Inline function may be useful (if it is small) for embedded systems because inline can yield less code than the function call outline and return.</li>
</ul>
</div>
</div>
<p style="text-align: justify;"><b>Disadvantages:</b></p>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>If you use too many inline functions then the size of the binary executable file will be large, because of the duplication of same code.</li>
<li>Too much inlining can also reduce your instruction cache hit rate, thus reducing the speed of instruction fetch from that of cache memory to that of primary memory.</li>
<li>It may cause compilation overhead as if somebody changes code inside inline function than all calling location will also be compiled.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
<div class="subheading" style="text-align: justify;">
<h2 id="const" class="color-green">Const:</h2>
</div>
<p style="text-align: justify;"><b>Advantages:</b></p>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>If you want any variable to keep constant through out the program then you can use const keyword.</li>
<li>It is stored in the read only of the initalized data segment , even the pointer storing it&#8217;s location cannot change the value of it, pointer can just change the address to point at some other location.</li>
</ul>
</div>
</div>
<p style="text-align: justify;"><b>Disadvantages:</b></p>
<div class="Content">
<div class="hddn">
<ul>
<li style="text-align: justify;">As the const is not flexible so mostly people use #define which is more flexible than const.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/what-are-the-advantages-and-disadvantages-of-using-inline-and-const/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
