Why pointer variable to a function as an argument, Computer Engineering

Assignment Help:

Why pointer variable sometimes desirable to pass a pointer to a function as an argument?

Frequently, a called function needs to make changes to objects declared in the calling function. For example, the function, scan(), needs to access objects in the calling function to store the data read and converted into an object defined there. Therefore, we supply scan() with the address of objects rather than their values.

Another common use of pointers is to write functions that ''return'' more than one value. As we have seen, every function in C returns a value as the value of the function; however, if a function's meaning includes the return of several pieces of information, this single return value is not sufficient. In these cases, we can have the function return multiple data values indirectly, using pointers.

 


Related Discussions:- Why pointer variable to a function as an argument

By which transport protocol used, The transport protocol used by TFTP (Triv...

The transport protocol used by TFTP (Trivial File Transfer Protocol) is? The transport protocol used through Trivial File Transfer Protocol is UDP.

Specifying constraint problems, Specifying Constraint Problems: Howeve...

Specifying Constraint Problems: However as with most successful "AI" techniques there constraint solving is all about solving problems as: somehow phrase the intelligent task

Chemistry, application problems on electrochemical series

application problems on electrochemical series

Explain single instruction and multiple data stream (simd), Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE Figure: SIMD Organisation

State about the object oriented analysis, State about the Object oriented a...

State about the Object oriented analysis Object oriented analysis (OOA) is concerned with developing software engineering specifications and requirements that expressed as a s

What is a pointer, What is a pointer? The register or memory location t...

What is a pointer? The register or memory location that having the address of an operand is known as a pointer.

Define opcode and operands, Q. Define Opcode and Operands? The most com...

Q. Define Opcode and Operands? The most common fields which are found in instruction formats are: Opcode: (What operation to perform?)  An operation code field cal

Name the numerous household devices, Name the Numerous household devices ...

Name the Numerous household devices Numerous household devices now use microprocessors to control their different functions. The following is just a sample of common devices (d

Define the term package- object oriented modeling, Define the term package-...

Define the term package- object oriented modeling A package is a common purpose mechanism for organising elements into groups. Package can also contain other packages. The no

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd