<?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>c++ pointers - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/c-pointers/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/c-pointers/</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>c++ pointers - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/c-pointers/</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>
	</channel>
</rss>
