What is a pointer data type in c?

are pointers to an integer or unsigned data type?

+7
c pointers
source share
6 answers

Not. They are pointers whose size depends on the system and whose only compatible type is void* .

+22
source share

Pointers are of type pointer. If you ask about how pointer values ​​are represented in memory, it really depends on the platform. They can be simple integral values ​​(as in a flat memory model), or they can be structured values ​​such as page number and offset (for a segmented model), or they can be something else.

+7
source share

In C, a pointer can access variables of any data type. The pointer must be declared with the data type of the variable that the pointer points to. To print the address of the pointer in hexadecimal format, use %p and to print the address in other forms, use %u . If the pointer will be used to display the value of the pointing variable, use *pointer_name and just use pointer_name for the address.

+1
source share

int * p;

data type * p is a pointer. And this points to an integer type variable. It stores the address in hexadecimal format.

-2
source share

Pointers to any data type can either be from char / int / float / double / ... - these are unsigned integers.

Reason : since the pointer stores the address, which is a place in the computer's memory, it is always positive, cannot be negative.

-4
source share

What is the data type of a pointer in C? This is a unique question.

You should not deviate from the question in order to give any explanation to the pointers as an answer to the question?

Answer.

  • What is the data type name for the intergers set in C? The name is an int, which is the name of the set containing all valid integers. Therefore, we declare int x; where x can take any value from the set.

  • Similarly, what is the name of the set of all valid addresses or pointers ?. The name of the set can only be the symbol "*", as I understand it, although no explanation is found anywhere in the descriptions in C.

Therefore, we declare a pointer variable as * x; where * is the name of the data type. Otherwise, you should think about the data type of the pointer and enter it under the user-defined data type. Since there are all RAM cells, the * * data type forms a subset of the valid and accebile memory cells. Therefore, this is the name of the data type for the set of pointers.

int is a modifier, as in signed char c; where signed is a modifier in C.Hence, we can have int * x; means that the data in the location is an integer, which is the necessary information for the compiler.

C talks about the data type of the pointer as the type of user data. It may be wrong to consider the pointer data type as the type of user data, since the user does not have control over the set of pointers in the set, following the basic concept int is the name of the set, float is the given name, char is the given character name, double is the given name of high-precision floating-point numbers, color - name of the data type in color enum = {blue, red, yellow).

-4
source share

All Articles