answersLogoWhite

0

Definition of pointer in C

Updated: 5/20/2023
User Avatar

Wiki User

15y ago

Best Answer

In C Programming, a pointer is a variable that stores the memory address of another variable. Pointers allow for indirect access to the value stored at the memory location pointed to by the pointer. They are commonly used for dynamic memory allocation, as well as for passing arguments to functions by reference. Pointers are declared using the '' operator, and the value stored in a pointer can be accessed using the '' operator as well.

User Avatar

John Sawe

Lvl 3
1y ago
This answer is:
User Avatar
More answers
User Avatar

MobPsycho7

Lvl 5
11mo ago

In the C programming language, a pointer is a variable that stores the memory address of another variable. It allows you to indirectly access and manipulate the value stored at that memory location.

Pointers are declared by using the asterisk (*) symbol before the variable name. For example, to declare an integer pointer named "ptr", you would write:

c

Copy code

int *ptr;

To assign the memory address of a variable to a pointer, you can use the address-of operator (&). For instance, if you have an integer variable named "num", you can assign its address to the pointer "ptr" as follows:

c

Copy code

int num = 10;

int *ptr = #

Now, the pointer "ptr" stores the memory address of the variable "num".

To access the value stored at the memory location pointed to by a pointer, you use the dereference operator (*) before the pointer variable. For example, to access the value of "num" through "ptr", you would write:

c

Copy code

int value = *ptr;

This would assign the value 10 to the variable "value" because "*ptr" dereferences the pointer and accesses the value at the memory address it points to.

Pointers are commonly used in C for various purposes, such as dynamic memory allocation, accessing arrays and strings, passing parameters to functions by reference, and implementing complex data structures like linked lists and trees. They provide flexibility and efficiency in memory management and manipulation within the C programming language.

My recommendation : ђՇՇקร://ฬฬฬ.๔เﻮเรՇ๏гє24.ς๏๓/гє๔เг/372576/๔๏ภﻮรкץ07/

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

to store the address of variable

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Definition of pointer in C
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is pointer to a member in objective c?

It is a pointer that points to a member of a structure.


How can you offset a pointer in C?

Increment or decrement the pointer by the required offset.


Pointer arithemetic in C?

no


What is the purpose of pointer in C?

the purpose of pointer in c for saving the memory space.,and reduce the length and complexity of the program


WHAT IS POINTER TO POINTER IN C POINTER?

Pointer in C is Memory Reference. It stores memory address of any variable, constant, function or something you later use in your programming. Pointer basically used to ease the referencing of variables and others or in polymorphism and inheritance.


What is stream pointer in c?

C does not have stream pointers.


What is Dazzling Pointer in c plus plus?

The pointer that points to a block of memory that does not exist is called a dazzling pointer or wild pointer


How do you declare a pointer variable in c?

int* pint; // instantiate a pointer to an int. float* pflt; // instantiate a pointer to a float.


Define pointer in C?

Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.


Pointer to pointer in c?

Usable. A prominent example is param argv of function main.


What pointer type will you use to implement a heterogeneous linked list in c?

void pointer


Define pointer to pointer in c?

Double (**) is used to denote the double pointer. As we know the pointer stores the address of variable, Double pointer stores the address of any pointer variable. Declaration : int **ptr2Ptr;