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

Returns and procedures definitions in 8086, Q. Returns and Procedures defin...

Q. Returns and Procedures definitions in 8086? 8086 microprocessor supports RET and CALL instructions for procedure call. CALL instruction not only branches to indicate address

Is the process before and after the swap are the same, Is the Process befor...

Is the Process before and after the swap are the same? Give reason. Process before swapping is residing in the primary memory in its original form. The regions (text, data and

DBMS, what is dbms goal?

what is dbms goal?

Explain about the e-commerce over extranets, Explain about the e-commerce o...

Explain about the e-commerce over extranets. Extranets are regarding “joining up” the supply chain-suppliers, distributors, resellers and customers are enabling business-to bus

What is input - output commands, Q. What is Input - Output commands? Th...

Q. What is Input - Output commands? There are four kinds of I/O commands which an I/O interface can receive when it's addressed by a processor: Control : This type of c

Communication of request/response - procedural interaction, Explain the Com...

Explain the Communications of Request/Response Communications requirements for message or procedural- based interaction are very similar. Application interaction (client-server

What do you mean by artificial intelligence, Q. What do you mean by artific...

Q. What do you mean by artificial intelligence? Show the artificial intelligence systems used widely in business. ANSWER: Artificial intelligence (AI) is the science of making

Explain 32 to 1 multiplexer tree, Why is Multiplexer Tree needed? Draw ...

Why is Multiplexer Tree needed? Draw the block diagram of a 32:1 Multiplexer Tree and explain how input is directed to the output in this system. Ans. One of the possible

Explain simplifying the sop boolean expression using k-map, Explain Simplif...

Explain Simplifying the SOP f the Boolean expression using the K-Map? To simplify the SOP of the Boolean expression using the K map, first identify all the input combinations tha

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