Top Answer
User Avatar
Wiki User
Answered 2009-12-25 12:42:05

Unitialized pointer may contain any value, so if you should use them, the results are unpredictable; NULL value on the other hands explicitly means that the pointer does not point anywhere.


size_t ListLen (const List *p)


size_t len= 0;

while (p != NULL) {


p= p->Next;


return len;


User Avatar

Your Answer

Related Questions

Java doesn't have pointers. C++ has pointers.

There is a difference: a pointer is a number that literally points to a place in memory. Arrays are groupings of a type. There is a close relationship between pointers and arrays, however: every expression with arrays (example: array[i]) can be expressed with pointers (example: *(array + i)), because for the computer, an array is just a list of pointers to the type of the array.

A pointer is simply a variable that can store a memory address and has the same purpose in both languages. The only real difference is that C++ pointers can point at objects (instances of a class) and indirectly invoke their methods, whereas pointers in C (which is not object oriented) cannot.

A pointer is a variable. A structure is a type.

An array of pointers is that for eg if we have array of 10 int pointers ie int *a[10] then each element that which is stored in array are pointed by pointers. here we will have ten pointers. In pointer to an array for eg int(*a)[10] here all the elements that is all the ten elements are pointed by a single pointer.

What is the deference between Insertion Point and Pointers?

An array is a collection of objects of similar data type ,whereas pointers are variable which is used to hold the address of the other variable.

A void pointer is a pointer that has no type information attached to it.A null pointer is a pointer that points to "nothing". A null pointer can be of any type (void included, of course).

In C programming, header files are required. It doesn't matter if you are using near pointers, far pointers, both, or neither -- you still need header files. There is no connection between the necessity of header files and the pointers' size.

A pointer is a variable that stores value of address of a variable. Since a pointer itself is a variable, it is allocated a memory location.Pointer to pointer means a pointer which points to the address of a pointer. In other words a pointer to a pointer has the address of the address of a variable.We can have pointers to int, and pointers to char, and pointers to any structures we've defined, and in fact pointers to any type in C, it shouldn't come as too much of a surprise that we can have pointers to other pointers. If we're used to thinking about simple pointers, and to keeping clear in our minds the distinction between the pointer itself and what it points to, we should be able to think about pointers to pointers, too, although we'll now have to distinguish between the pointer, what it points to, and what the pointer that it points to points.

Java is an object-oriented language, without pointers, garbage collected. C is a procedural language, with pointers, not garbage collected. Basically, the standard distribution of Java compiles to C and then to machine code.

A tree is a structure where each node contains none, one, or more pointers to child nodes. A binary tree is a tree with at most two pointers to child nodes in each node.

"What is the difference between bracketing method and iterative method in solving Algebraic and Transcendental equations. Name some methods which lie under both these categories. Also describe the differences between Trapezoidal rule, Simpson's 1/3 rule and Simpson's 3/8 rule."

In the NBA it's a tie between Kobe Bryant and Donyell Marshall. They both tie on 12 three pointers in a game.

They exist in different contexts. Handles are like... well handles (or keys, tickets, references etc), to access objects (like files, sockets, resources) you have opened (created, allocated, etc); in the program they can be integers or pointers.

pointer is used when we want to retain the change in values between the function calls. Similarly double pointer is used when we want to retain the change in pointers between the function calls. If you want to modify pointers than you need double pointer to retain the change.

Well, the pointer is a type of variables that stores an address in the Memory.the reference is the address itself of a variable.

An array of pointers is exactly what it sounds like - one or more pointers arranged in order in memory, accessible through a common base name and indexed as needed. Philosophically, there is no difference between an array of pointers and an array of a[10]; // 10 integers, named a[0], a[1], a[2], ..., a[9]int *b[10]; // 10 pointers to int, named b[0], b[1], b[2], ..., b[9]If you initialize the array of i;for (i = 0; i ... then *b[0] would be the same as a[0], etc.

There is no such thing as an "array to pointer." What you might be asking is "array of pointers." An array of pointers is just that, an array in which the variables are pointers. In C this would be an array of pointer variables that are each 4 bytes in size. It is declared like this: int *pointers[3]; A pointer to an array is a pointer that points to the whole array. For example, in C if you have int numbers[5][10]; int (*pointerToArray)[10] = numbers + 2; pointerToArray points to the third element of numbers, which is itself an array.

C plus supports the use of pointers, where as java does not. because the use of pointers may makes the coding difficult. C plus supports multiple inheritance. where as java does not supports multiple inheritance. java is platform independent.

array and pointer both are derived datatypes..

The setters in the dog world do both kill and retrieve. They set or crouch behind prey and bring it down. The retrievers get the prey after the master shoots it. The pointers point to the prey for the hunters to shoot. The spaniels flush out prey for the master to shoot in the air.

No, but subtraction between pointers to the same type is possible.

It has to do with the memory model you are using... If you are using the LARGE or HUGE memory model, then you use HUGE memory pointers. == Huge pointers are like far pointers, just more so: they are always normalized (ie offset part is between 0 and 15), and segment wrapping-around do not occur if you use them.

Copyright ยฉ 2021 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.