Skip to main content

What is the pointer

Pointer

A pointer is a variable that stores the memory address of another variable.  In above example ‘ptr’ is a pointer variable because it stores the address of another variable ‘n’. Hence it is called a pointer to n. Since a pointer is a variable, it will also occupy some memory location. 
Value of variable ‘n’ can be accessed in two ways: 
Using the name of the variable i.e. ‘n’ 
Using pointer

Reference and De-reference Referencing means taking the address of an existing variable (using &) to set a pointer variable. 

The operation of accessing variable using the pointer is called ‘dereference’. For example, accessing variable ‘n’ using ‘ptr’ is called dereference. De-referencing is the operation to access or manipulate data contained in the memory location pointed to by a pointer.
The ‘&’ operator is used for reference. It is also called the ‘address-of ‘operator. The ‘*’ operator is used for dereference. It is also called the ‘value-at’ operator. 
Syntax: *pointer 
Example: 
int n=20; 
int *ptr; 
ptr = &n; //reference printf(“%d”,*ptr); //deference. Displays 20 Size of a pointer 

 A pointer is a variable. Hence it occupies some memory. The size of a pointer variable is the same as an unsigned integer (either 2 or 4 bytes). 
 
The size of pointer does not depend on the type of data it points to. 
sizeof()operator can be used to find out the size of a pointer variable as shown below: Example: 
float *ptr; 
printf(“The size of ptr is %d”, sizeof(ptr));

Comments

Trending⚡

Understanding link.click() in JavaScript

Hey! Today i am going to share with you how to use link.click() function in javascript As a JavaScript developer, you may come across the need to programmatically click a link on a web page. The link.click() method is a commonly used way to do this, and it is important to understand how it works and when to use it. What is link.click()? link.click() is a method that can be used to simulate a click on a link element in JavaScript. It is typically used when you want to trigger a link click event programmatically, rather than requiring the user to physically click the link. How to use link.click() Using link.click() is relatively straightforward. First, you need to select the link element you want to click using a DOM selector such as getElementById() or querySelector(). Then, you can call the click() method on the link element to simulate a click. Here is an example: // select the link element const myLink = document.getElementById('my-link'); // simulate a cl...

Policy vs Innovation Matrix - India

Policy vs Innovation Matrix Policy vs Innovation Matrix that shows the structural difference between policy intent and actual innovation output — and how India’s model is transforming to match global innovation systems . From Paper Policies to Product Power 🧱 Traditional Indian Model (Old System) Policy Layer Reality Innovation Outcome Policy Vision Strong national policies Vision without execution pipelines Funding Govt-dominated funding Limited capital availability Risk Culture Risk-averse systems No deep-tech experimentation Research Academic publications Low commercialization Industry Role Minimal R&D involvement Weak private innovation Infrastructure Limited labs & compute Research bottlenecks Talent High-quality brains Brain drain Commercialisation Weak tech transfer Research stays in journals Scale Fragmented schemes No national scale impact Speed Slow approvals Innovation delays Result: ➡ Policy existed ➡ Innovation did not scale ➡ Research stayed inside institutions ...

India’s Landmark Era of Research, Innovation & Deep-Tech Growth

India’s research and development (R&D) ecosystem is undergoing a historic transformation. The country is shifting from a primarily public-funded research model to a private-sector-driven, innovation-led economy , backed by massive strategic investments. This transformation directly supports the national vision of Viksit Bharat @ 2047 , with Investment and Innovation identified as two of the four core growth engines in the 2025–26 Union Budget . The focus is clear: ➡ Build global innovation leadership ➡ Strengthen deep-tech infrastructure ➡ Attract private capital into strategic sectors ➡ Create a strong research-to-commercialisation pipeline 🧠 Strategic Institutional Foundations Anusandhan National Research Foundation (ANRF) Operational since 2024 Target: ₹50,000 crore mobilisation over 5 years Purpose: Bridge academia–industry collaboration Provide strategic national direction in science & technology Enable interdisciplinary research to solve complex societal challenges R...

The 175 Billion Parameter Question: 5 Surprising Lessons from GPT-3

The 175 Billion Parameter Question: 5 Surprising Lessons from GPT-3 Is scale alone enough to transform artificial intelligence? When GPT-3 launched with 175 billion parameters , it didn’t just break records — it reshaped how we think about intelligence itself. The End of Specialized AI: A Paradigm Shift For nearly a decade, artificial intelligence advanced through specialization. Engineers built narrow systems: one for translation, another for summarization, another for classification. Each required curated datasets and task-specific fine-tuning. This approach worked — but it was fragile. Unlike humans, who can understand new tasks from a single instruction, traditional AI systems required thousands of labeled examples. GPT-3 changed that equation. By scaling a single autoregressive model to 175 billion parameters, researchers demonstrated that size itself could unlock general-purpose adaptability. Instead of retraining for each task, GPT-3 adapts...

Quiz tells you what type of wife you want

What Type of Wife are You Looking For? Attend this quiz and know your wife expections Quiz reveals type of wife you expect, lets answer carefully... Personality Questions: 1. What type of personality are you looking for in a wife? Quiet and reserved Outgoing and social Intelligent and witty 2. What type of sense of humor are you looking for in a wife? Dry and sarcastic Witty and clever Playful and silly 3. What type of interests are you looking for in a wife? Intellectual and educational Creative and artistic Athletic and outdoorsy Values Questions: 4. What type of family values are you looking for in a wife? Traditional and conservative Open-minded and progressive Balanced and equal 5. What type of political views...

Linked List Data Structure

Linked List Prerequisites for Linked List Definition of linkedlist Important points of Linked List Types of Linked List Basic Operations performed on Linked List Difference Between Linked List and Arrays Drawbacks of Linked List Applications of Linked List In real world Singly Linked List in C Doubly Linked List in C Singly Circular Linked List in C Doubly Circular Linked Listist in C Add node in Singly Linked List Display Data of Linked List Deletion of a node from linked list Prerequisites for Linked List pointer concept (*ptr) Address Operator (&ptr) Pointer A pointer is a variable which stores the address of another variable. By using a pointer we can directly access the memory address of the variable. Like any variable or constant, you must declare a pointer before using it to store any variable address. The general form of a pointer variable declaration is type *variable-name; Here, type is the pointer...