There are many uses of pointer in C. Pointers are efficient and elegant to use.
All string variables are pointers, and calling a function using a pointer allows the function to change the value globally. These are what you can do with pointers in C. 1) Returning multiple values by passing address of variables. eg. foo(&a,&b,&c); 2) When you want to modify the value passed to function. eg. scanf() function.
int n;
scanf("%d",&n); /* pass address of variable n so that scanf can change its value*/
3) When you need to pass large data structure to function, it is more efficient to pass pointer to structure than passing the entire structure. If you don't want to modify the structure members, you can use 'const' keyword which the ANSI-complaint C compiler will either warn or give error if you modify. eg strlen(const char *str) in string library should not modify the content of str.
4) Implementing 'goto' data structures are easy with pointers. eg. linked-list,binary trees, hash table.
5) You can allocate dynamic memory using pointers.
6) Pointers to function are used for call back function and jump table. eg qsort() and bsearch() functions require the caller to provide pointer to function to do the comparison.
find the address
Yes, you can use pointers in the C#, but to some extent. Links are added with more details.
Pointers in C are generally the thing that gives learners the most trouble. When C code is not written correctly with respect to pointer use, the resulting bugs can often be very difficult to find and correct. On the other hand, pointers are absolutely necessary in some cases.The designers of Java wanted to make programming easier and hence avoided adding pointers to the language. Java does have object references which accomplish much of what pointers accomplish albeit in a safer way.
Java doesn't have pointers. C++ has pointers.
You can either use references or you can simply return the result by value. Note that in C++, unlike C, references are not the same as pointers. C++ references are aliases, alternate names for existing objects, whereas pointers are just variables that may contain a memory address that can be dereferenced.
C does not have stream pointers.
Don't store pointers in files, it makes no sense.
a pointer is a derived data type in c. pointers are undoubtedly one of the most distinct and exciting features of c language.it has added power and flexibility to the language. *pointers are more efficient in handling arrays and tables. *pointer can be used to support dynamic memory management. *pointers reduce length and complexity of programs. *increase the execution speed and thus reduce the program execution time. by following character's real power of c lies in proper use of pointers. pointer is called the jewel of c-language.
C and C++ will help you understand the inner workings of a computer with operations such as dealing with memory and pointers. It will do anything that you tell it to do, which is both an advantage and a disadvantage.
Yes. Its just (sort of) like C and C++. The difference is that Java does not have pointers, it has references, but, philosophically, its the same thing.
pointers.
Nothing.