Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the datatype of pointer in c?

Tags:

c

pointers

are pointers of integer or unsigned datatype?

like image 397
user384636 Avatar asked Oct 20 '10 09:10

user384636


People also ask

What is the type of a pointer?

There are majorly four types of pointers, they are: Null Pointer. Void Pointer. Wild Pointer.

What type of data is stored in a pointer?

A pointer is a variable that stores a memory address. Pointers are used to store the addresses of other variables or memory items. Pointers are very useful for another type of parameter passing, usually referred to as Pass By Address.


2 Answers

No. They're pointers, whose size is system-dependent and whose only compatible type is void*.

like image 190
Ignacio Vazquez-Abrams Avatar answered Sep 27 '22 21:09

Ignacio Vazquez-Abrams


Pointers are of pointer type. If you're asking about how pointer values are represented in memory, that really depends on the platform. They may be simple integral values (as in a flat memory model), or they may be structured values like a page number and an offset (for a segmented model), or they may be something else entirely.

like image 35
John Bode Avatar answered Sep 27 '22 21:09

John Bode