answersLogoWhite

0

Why only three types of pointer variable in c language?

Updated: 8/18/2019
User Avatar

Wiki User

13y ago

Best Answer

I have no idea what you mean by that... Some examples for pointers of different types:

int *intptr;

char *charptr;

void *generic_ptr;

FILE *stdin;

int (*funptr)(int, char **);

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why only three types of pointer variable in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many types of pointers are there?

That depends on what you consider a type. A pointer variable simply stores a memory address or NULL so, strictly speaking, there is only one type of pointer. A pointer variable's type (int *, char *, void *, etc) determines the type that a pointer points to, not the type of the pointer itself. Whether a pointer points to a primitive type, a user-defined type, a function, another pointer or void, makes no difference to the pointer variable itself. It simply stores a memory address. How you treat that memory address is determined by the pointer variable's type. So, in that respect, there are as many types of pointer as there are types to point at; which would be infinite. The architecture determines the size of a pointer variable. On a 16-bit system, a pointer will occupy just 2 bytes, while on a 32-bit system it occupies 4 bytes and 8 bytes on a 64-bit system. Although these may be considered separate pointer types, you can't pick and choose which type you use. The size must be consistent for any given architecture, hence the prevalent use of the sizeof() operator to determine a variable's length at runtime.


Different types of pointers in c language?

... are usable. void pointer (generic pointer) : a special type of pointer which point to some data of no specific types. void *p; null pointer : a special type of pointer which point nowhere. it is usually used to check if a pointer is pointing to a null or free the pointer during deallocation of memory in dynamic memory allocation; it is define by using the predefine constant NULL int *p=NULL; wild pointer : uninitialized pointer. it hold a garbage value. i.e it is not pointing to any memory location yet. dangling pointer: pointer pointing to a destroyed variable. it usually happen during dynamic memory allocation when the object is destroyed but not free and the pointer is still pointing to the destroy object.


What are Three types of variables?

Control Variable, Independent Variable, Dependent Variable.


Three types of scoring in basket ball game?

Free throw, 2 pointer, 3 pointer.


Differentiate the three types of variable?

differentiate the three types of variables from one another


What are the types of a variable?

the types of variables are three the constant,manipulated and responding...


What is a description of the three different types of variable?

we dinga this is my answer


What are three types of variables in a scientific inquiry?

I'm thirteen so don't be embarrassed if i know it and you don't. ( no offense) The three types of variables in scientific inquiry is Independent variable Dependent variable Control variable


What are three types of insurance annuities?

Three types of Insurance Annuities are variable annuities, fixed annuities and indexed annuities.


What types of variables are useful to programmer?

All variable types in a given computer language are useful to a programmer, otherwise they would not be included in the language. However, a specific program may not need to use all types to solve a given problem.In general, there are two distinct categories of variable types: primitive types and derived types.A primitive variable type is one whose definition is stated by the program language itself. Common primitive variable types are Integers, Characters, Floating Point numbers, and Arrays. The meaning of these types is fixed, and cannot change. Most languages seldom have more than a half-dozen primitive variable types.A derived variable type is one which is created by combining two or more primitive types together. It is possible to create a huge variety of different derived variable types. Items such as HashMaps, Strings, and Linked Lists are common derived variable types.


What are the three types of variables?

The three types of variables are: Independent: it is the one that you manipulate Dependent: the one that reacts to the changes in the independent variable and is measured in a experiment Control: all the other factors that could affect the dependent variable but are kept constant through out an experiment


What is the difference between pointer before a variable and pointer after a variable?

I presume you referring to the C pointer syntax where an asterisk operator may be suffixed to a type or prefixed to a variable. The following may help to clarify: int*p; int* q; int *r; int * s; All four of these declarations are exactly the same (they are all pointer-to-int variables). Note that the physical position of the asterisk operator makes no difference whatsoever, no matter how much whitespace you use (whitespace is essentially ignored both before and after an operator). Because the type is pointer-to-int, it usually makes sense to use the second variant to separate the variable's type from its name. However, this doesn't really work when declaring multiple pointer variables of the same type on the same line using the comma operator. Consider the following: int* p, q, r, s; While it is natural to assume p, q, r and s are all pointer-to-int types, they are not. The first, p, is the only pointer-to-int type, while all the others are just plain int types. If we really want 4 pointer-to-int types, we need to use the following declaration instead: int *p, *q, *r, *s;