answersLogoWhite

0

Why you use pointers?

Updated: 8/16/2019
User Avatar

Wiki User

13y ago

Best Answer

Because you can produce fast and efficient code. Function arguments are passed "by value", and so you can't change the original value of the argument, but if you use pointers, you can.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why you use pointers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


Do you use pointers in java?

no


Why to use pointers in programs?

To use memory effectively. . .


What are five safety pointers for use in electronic shop work?

safety pointers in electric shop


Pointers are include in csharp or not?

Yes, you can use pointers in the C#, but to some extent. Links are added with more details.


What kind of drills do you use for three pointers two pointers and foul shots?

just keep shooting its not that hard


Why laser mouse are used?

Because the laser pointers are much easier to use than the ball pointers. The ball pointers are often difficult to move around while the laser pointers can move in any direction without "getting stuck"


What you use in case of pointer in java?

Java does not have pointers


What do you use to supplement your current testing methods with the ability to flag memory leaks and unassigned pointers you use?

I have no need to flag memory leaks or unassigned pointers because I eliminate all leaks at source by using resource handles, smart pointers and making proper use of RAII.


What is the need to use pointers in C programming?

find the address


In C you use the concept of pointers whereas there are no pointers used in JAVA why?

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.


Why are they no pointers in java?

Pointers are a crucial feature of several programming languages, including C and C++, that allow direct manipulation of memory addresses. Pointers are used to create dynamic data structures, access memory directly, and create efficient algorithms. However, pointers are not available in the Java programming language. In this article, we will explore why pointers are not present in Java and the advantages and disadvantages of this decision. The main reason why pointers are not present in Java is security. Pointers allow direct access to memory addresses, which can be used to manipulate memory in unexpected ways. In Java, memory is managed automatically by the Java Virtual Machine (JVM), which helps to prevent accidental or intentional manipulation of memory. This is important for security, as malicious code could use pointers to gain unauthorized access to sensitive data or systems. By removing pointers, Java ensures that all memory access is controlled and managed, which helps to prevent security threats. Another reason why pointers are not present in Java is the ease of use. Pointers are a complex feature that can be difficult for beginner programmers to understand and use effectively. Java was designed to be an easy-to-use programming language, and by removing pointers, Java makes it easier for beginners to write correct, secure code. Java also makes it easier for programmers to write portable code, as the absence of pointers ensures that code written in Java will work on any device that supports the Java Virtual Machine. However, the absence of pointers in Java also has some disadvantages. One of the main disadvantages is that Java can be slower than languages that support pointers, as the automatic memory management provided by the JVM can be less efficient than direct memory manipulation. When handling large amounts of data, the JVM may not be able to allocate memory as efficiently as a programmer working directly with pointers. When working with pointers, a programmer has complete control over the memory allocation and can optimize it for their specific use case. Another disadvantage of the absence of pointers in Java is that some algorithms and data structures cannot be implemented as efficiently as they can be in languages that support pointers. For example, binary trees can and linked lists and are implemented more efficiently in C or C++, as they can use pointers to link nodes together in memory. Java must use other techniques, such as object references, to implement these structures, which can result in slower and less efficient code. In conclusion, the absence of pointers in Java was a deliberate decision made to improve the security and ease of use of the language. This decision has both advantages and disadvantages, as Java is easier to use and more secure, but it can be slower and less flexible than languages that support pointers. Nevertheless, the popularity of Java and its widespread use in industry and academia demonstrate that the benefits of the absence of pointers outweigh the drawbacks.