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

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.


Posted Date: 6/14/2013 7:08:34 AM | Location : United States

Related Discussions:- Why pointer variable to a function as an argument, Assignment Help, Ask Question on Why pointer variable to a function as an argument, Get Answer, Expert's Help, Why pointer variable to a function as an argument Discussions

Write discussion on Why pointer variable to a function as an argument
Your posts are moderated
Related Questions
Explain what is a transaction in SAP terminology. In SAP terminology, a transaction is series of logically linked dialog steps.

TRP is the number of clock cycles required to terminate access to an open row of memory, and open access to the next row. It stand for row precharge time.

super string checker

What is a Demultiplexer ? Ans. Demultiplexer has similar circuit as decoder but here E is obtained as the particular input line, the output lines are similar as decode

What are the Objectives of UML trace development of UML; recognize and describe notations for object modelling using UML; describe a variety of structural and be

What types of calendars can you create with Google Calendar? Personal calendars, like default calendar Public calendars, which others can access through the web

Direct Rambus DRAM or DRDRAM (sometimes just known as Rambus DRAM or RDRAM) is a type of synchronous dynamic RAM. RDRAM was formed by Rambus inc., in the mid-1990s as a replacement

Rule in a single direction - equivalences rules: Hence there the power to replace  sub expressions always allows use to prove theorems with equivalences: as given in the above

Performance Equation of computer system: Following equation is frequently used for expressing a computer's performance ability: The CISC approach tries to minimize the

Explain the Paging Unit Paging mechanism functions with 4K - byte memory pages or with a new extension available to Pentium with 4M byte-memory pages. In Pentium, with new 4M-b