The main drawback is that they're a bit more difficult to use than references. References always point to valid data (they can never be NULL), but pointers may be NULL or may point to arbitrary data, including other pointers. The programmer is therefore entirely responsible for ensuring their pointers point at valid data before they can actually use that data; the compiler is not able to foretell the runtime condition of a pointer. When there is a choice between using a reference or a pointer to a reference, the reference is the preferred choice. But if there's any chance the reference could be NULL, a pointer must be used instead.
If memory is allocated to a pointer (using malloc or new), the programmer is responsible for releasing that memory, otherwise a memory leak will occur. By contrast, references will fall from scope automatically. However, a danger here is that the programmer may point to a reference that falls from scope, leaving a dangling pointer. Any attempt to access that pointer may result in a runtime error (if not, it is a "time-bomb" which may crash the program at a later time, with no indication as to the cause).
Pointers can also be used to "rove" within the data of an object, a structure or an array. While this is a powerful feature, great care must be taken to ensure the data is valid. For instance, overrunning a data buffer is a common source of errors and can lead to exploitation by hackers who may be able to inject arbitrary code into your code, with all the same privileges of the original code. This is particularly dangerous when functions accept pointers to unchecked data buffers which can overwrite the return address of the function to point at the "infected" code in the buffer.
While there are drawbacks to using pointers, with appropriate usage they make it possible to produce more efficient code than might otherwise be possible with references alone. Thus the only real drawback is when they are used inappropriately.
program to find maximum of two numbers using pointers
Pointers are a concept in C wherein the programmer can access the system memory and process it. Pointers are considered the most complex as well as confusing part of the C programming language. almost all C programs using pointers had hours of time spent by the programmers to sort out errors they induced in their code using pointers. So Java conveniently avoided pointers :)
this is immpossible
Accessing data by address. Some data-structures, like lists and trees, are usually implemented using pointers.
In computer terminology, pointer is a programming language. It is an important part of C language. Uses of pointers: C pointer, C arrays, C linked list, memory-mapped hardware, Pass-by-address using pointers, Dynamic memory allocation.
i don't have any knowledge about your ques. but i guide you to read the "Writing TSR through C" & learn knowledge of FAR & HUGE ponters.by this you can access the adminstrator password using pointers in C.
pro c language to implement linear search using pointers
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.
Cartesian coordinates c language
We can use pointers in user defined functions, the reason behind is we can access the actual parameters indirectly by using pointers. And also we can reduce the length of a complicated program into very small code. It is easy to manipulate with pointers.
to calculate standard deviation using pointers
Java doesn't have pointers. C++ has pointers.
i cant write
1. Basics of C 2. Pointers 3. Function Pointers 4. Pointers Arithmetic 5. Most Important playing with pointers. 6. Algorithm to Solve Problems
C does not have stream pointers.
Pointer is a variable which points to the address of another variable. Pointers come handy when we are left with no choices such as calling a function using "pass by reference" method, using memory allocated dynamically etc...
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.
The appropriate term would be "Pointers were avoided when Java was created" The C language gives access to its memory to the developer which gives great powers to the programmer but its like giving a dynamite. Pointers caused more harm than good to the developers world over while using the C language. Any C developer you talk to would have a story to narrate regarding his tough experience with pointers. Hence the team that created the Java language took a decision to avoid the concept of Pointers from this new language they were creating. Hence Java doesnt have pointers.
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.