<?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>pointers in c - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/pointers-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/pointers-in-c/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 03 Oct 2022 06:33:50 +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>pointers in c - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/pointers-in-c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is Pointer in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-pointer-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-pointer-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 06:33:50 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[advantage of pointers in c]]></category>
		<category><![CDATA[c++ pointers]]></category>
		<category><![CDATA[c++ pointers with examples]]></category>
		<category><![CDATA[pointer arithmetic in c]]></category>
		<category><![CDATA[pointers in c]]></category>
		<category><![CDATA[pointers in c and c++]]></category>
		<category><![CDATA[what are pointers in c]]></category>
		<category><![CDATA[what is pointer]]></category>
		<category><![CDATA[what is pointer in c programming]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4903</guid>

					<description><![CDATA[For storing the address of another variable pointers can be used. Variables of type int,char, array, function or any other pointer can be of type pointer. Architecture of a pointer determines the size of the pointer. Size of the pointer depends on the architecture. In 32 bit the size of the pointer is 2 byte. [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">For storing the address of another variable pointers can be used.</li>
<li style="text-align: justify;">Variables of type int,char, array, function or any other pointer can be of type pointer.</li>
<li style="text-align: justify;">Architecture of a pointer determines the size of the pointer.</li>
<li style="text-align: justify;">Size of the pointer depends on the architecture.</li>
<li style="text-align: justify;">In 32 bit the size of the pointer is 2 byte.</li>
<li style="text-align: justify;">Using pointer some of programming tasks in C can be easily done.</li>
</ul>
<h2 id="declaring-a-pointer" style="text-align: justify;"><strong>Declaring a pointer</strong></h2>
<p style="text-align: justify; background: white;"><span lang="EN-US" style="font-size: 16.0pt; font-family: 'Segoe UI',sans-serif; color: #333333;">The pointer in c language can be declared using * (asterisk symbol). It is also known as indirection pointer used to dereference a pointer.</span></p>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int *a; //pointer to int  <br/>char *c;//pointer to char  </code></pre> </div>
<h3 id="pointer-example" style="text-align: justify;">Pointer Example:</h3>
<p style="text-align: justify;">An example of using pointers to print the address and value is given below.</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4904 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c.jpg" alt="" width="595" height="297" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c.jpg 595w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c-300x150.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c-390x195.jpg 390w" sizes="(max-width: 595px) 100vw, 595px" /></p>
<h3 id="pointer-to-array" style="text-align: justify;"><strong>Pointer to array</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int arr[10];  <br/>int *p[10]=&amp;arr; </code></pre> </div>
<h3 id="pointer-to-a-function" style="text-align: justify;"><strong>Pointer to a function</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">void show (int);  <br/>void(*p)(int) = &amp;display; </code></pre> </div>
<h3 id="pointer-to-structure" style="text-align: justify;"><strong> </strong><strong>Pointer to Structure</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">struct st {  <br/><br/>   int i;  <br/><br/>    float f;  <br/><br/>}ref;  <br/><br/>struct st *p = &amp;ref;  </code></pre> </div>
<p style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4905 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/pointer-to-structure.png" alt="" width="303" height="96" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/pointer-to-structure.png 303w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/pointer-to-structure-300x96.png 300w" sizes="(max-width: 303px) 100vw, 303px" /></p>
<h2 id="advantages-of-pointer" style="text-align: justify;">Advantages of Pointer</h2>
<ul style="text-align: justify;">
<li>Pointer reduces the code and improves the performance.</li>
<li>It is used to retrieving strings, trees, etc., and used with arrays, structures, and functions.</li>
<li>We can return multiple values from a function using the pointer.</li>
<li>It makes you able to access any memory location in the computer&#8217;s memory.</li>
</ul>
<h2 id="usage-of-pointer" style="text-align: justify;">Usage of pointer</h2>
<p style="text-align: justify;">There are many applications of pointers in c language.</p>
<p style="text-align: justify;"><strong>Dynamic memory allocation</strong></p>
<ul style="text-align: justify;">
<li>In C language, we can dynamically allocate memory using malloc() and calloc() functions where the pointer is used.</li>
</ul>
<p style="text-align: justify;"><strong>Arrays, Functions, and Structures</strong></p>
<ul style="text-align: justify;">
<li>Pointers in c language are widely used in arrays, functions, and structures.</li>
<li>It reduces the code and improves the performance.</li>
</ul>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-pointer-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Pointers in C++ ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/what-is-pointers-in-cpp/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/what-is-pointers-in-cpp/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 19 Aug 2022 09:41:33 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[c++ pointer]]></category>
		<category><![CDATA[c++ pointers]]></category>
		<category><![CDATA[c++ pointers with examples]]></category>
		<category><![CDATA[pointers in c]]></category>
		<category><![CDATA[pointers in c++/c++ with examples]]></category>
		<category><![CDATA[smart pointers in c++]]></category>
		<category><![CDATA[types of pointers in c]]></category>
		<category><![CDATA[what is pointer in c plus plus]]></category>
		<category><![CDATA[what is pointer in c++]]></category>
		<category><![CDATA[what is pointer in c++ definition]]></category>
		<category><![CDATA[what is pointer in c++ explain with example]]></category>
		<category><![CDATA[what is pointer in c++ syntax]]></category>
		<category><![CDATA[what is pointer in c++ types]]></category>
		<category><![CDATA[what is pointer in c++ with example]]></category>
		<category><![CDATA[what is pointers in c++ language]]></category>
		<category><![CDATA[what is pointers in c++ programming]]></category>
		<category><![CDATA[what is pointers in c++ with example]]></category>
		<category><![CDATA[what is pointers in cpp]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4798</guid>

					<description><![CDATA[Pointers are symbolic representation of addresses and it enables a program to simulate call-by-reference as well as to create and manipulate dynamic data structures. It defines a pointer variable and its general declaration in C/C++ has the format. Using unary operator (&#38;) assigning the address of a variable to a pointer which returns the address [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Pointers are symbolic representation of addresses and it enables a program to simulate call-by-reference as well as to create and manipulate dynamic data structures.</li>
<li style="text-align: justify;">It defines a pointer variable and its general declaration in C/C++ has the format.</li>
<li style="text-align: justify;">Using unary operator (&amp;) assigning the address of a variable to a pointer which returns the address of that variable.</li>
<li style="text-align: justify;">Using unary operator (*) accessing the value stored in the address which returns the value of the variable located at the address specified by its operand.</li>
<li style="text-align: justify;">When we increment a pointer, we increase the pointer by the size of data type to which it points, this is the reason data type to a pointer is knows how many bytes the data is stored inside.</li>
</ul>
<h2 id="syntax">Syntax</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-cpp code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-cpp code-embed-code">datatype *var_name; <br/>int *ptr;</code></pre> </div>
<h2 id="sample-code">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-cpp code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-cpp code-embed-code">#include &lt;iostream&gt;<br/>using namespace std;<br/>int main() {<br/>	int  x = 27;  <br/>	int  *ip;        <br/>	ip = &amp;x;       <br/>	cout &lt;&lt; &quot;Value of x is : &quot;;<br/>	cout &lt;&lt; x &lt;&lt; endl;<br/>	cout &lt;&lt; &quot;Value of ip is : &quot;;<br/>	cout &lt;&lt; ip&lt;&lt; endl;<br/>	cout &lt;&lt; &quot;Value of *ip is : &quot;;<br/>	cout &lt;&lt; *ip &lt;&lt; endl;<br/>	return 0;<br/>}</code></pre> </div>
<h2 id="output">Output</h2>
<p><img decoding="async" class="alignnone size-full wp-image-4799" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/pointers.png" alt="" width="541" height="150" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/pointers.png 541w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/pointers-300x83.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/pointers-390x108.png 390w" sizes="(max-width: 541px) 100vw, 541px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/what-is-pointers-in-cpp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the Output ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-the-output/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-the-output/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 20:01:05 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Accentur interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Asian Paints Ltd. interview questions and answers]]></category>
		<category><![CDATA[basic c programs]]></category>
		<category><![CDATA[basics of c]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[c c++ programs for interview]]></category>
		<category><![CDATA[c code]]></category>
		<category><![CDATA[c coding questions]]></category>
		<category><![CDATA[c interview questions]]></category>
		<category><![CDATA[c language]]></category>
		<category><![CDATA[c programming]]></category>
		<category><![CDATA[c programming basics]]></category>
		<category><![CDATA[c programming coding questions]]></category>
		<category><![CDATA[c programming examples]]></category>
		<category><![CDATA[c programming language]]></category>
		<category><![CDATA[c programming test questions]]></category>
		<category><![CDATA[c programming tricky questions]]></category>
		<category><![CDATA[c programming tutorial]]></category>
		<category><![CDATA[c programs with solutions]]></category>
		<category><![CDATA[c_language]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[computer programming]]></category>
		<category><![CDATA[cracking the coding interview]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[DHFL Pramerica Life Insurance Company Ltd interview questions and answers]]></category>
		<category><![CDATA[Elico HealthCare Services Ltd interview questions and answers]]></category>
		<category><![CDATA[examples of output devices]]></category>
		<category><![CDATA[factorial program in c]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[HCL Technol interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[interview questions and answers]]></category>
		<category><![CDATA[learn c programming]]></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[output definition computer]]></category>
		<category><![CDATA[output devices of computer and their functions]]></category>
		<category><![CDATA[pattern programs asked in interview]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[pointers in c]]></category>
		<category><![CDATA[programs asked in interview in java]]></category>
		<category><![CDATA[R Systems interview questions and answers]]></category>
		<category><![CDATA[Raqmiyat Information Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[strings in c]]></category>
		<category><![CDATA[Tata AIA Life Insurance interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindr interview questions and answers]]></category>
		<category><![CDATA[the c programming language]]></category>
		<category><![CDATA[The Linde Group interview questions and answers]]></category>
		<category><![CDATA[what is output in computer]]></category>
		<category><![CDATA[zycus infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=315</guid>

					<description><![CDATA[Answer : NULL...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="what-is-the-output" class="color-pink" style="text-align: justify;">What is the Output ?</h2>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">main () <br/>  {<br/>  char *p1=&quot;Name&quot;; <br/>  char *p2; <br/>  p2=(char *)malloc(20); <br/>  while(*p2++=*p1++); <br/>  printf(&quot;%s\n&quot;,p2); <br/>  } </code></pre> </div></figure>
</div>
</div>
<p style="text-align: justify;"><b>Answer</b> : NULL</p>
<div class="Content">
<div class="hddn">
<ul>
<li style="text-align: justify;">We are incrementing the pointers p1,p2.</li>
<li style="text-align: justify;">When it reached the end of the string, *p2 points to NULL.</li>
<li style="text-align: justify;">We have lost the address of the starting position.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-the-output/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
