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

Estimate the size of the state space, 1. The missionaries and cannibals pro...

1. The missionaries and cannibals problem. Three missionaries and three cannibals are on the left river bank, with a boat that can hold one or two people. If on either side of the

Typewriters information distribution, TYPEWRITERS : Typewriter is the most...

TYPEWRITERS : Typewriter is the most common machine used in almost all offices. Typewritten letters are attractive in appearance as compared to handwritten ones. The same matter c

Demultiplexers, Explain briefly about demultiplexers?

Explain briefly about demultiplexers?

Example to show a single digit, Q. Example to show a single digit ? Dis...

Q. Example to show a single digit ? Displaying a single digit (0 to 9) Presume that a value 5 is stored in BL register then to output BL as ASCII value add character ‘0' to

Block diagram of a microcomputer system, Q. Block Diagram of a Microcompute...

Q. Block Diagram of a Microcomputer System? Before going on to consider the I/O sub/systems of a computer, let's discuss how a digital computer system can be realized by a micr

External links to files, Somehow, the worksheet has external links to files...

Somehow, the worksheet has external links to files that are no longer around. How can we delete the links? Ans) This happens all of the time to MrExcel. I downloaded a little

C programming, You are given a collection of words, say as in a dictionary....

You are given a collection of words, say as in a dictionary. You can represent it in the following compressed form: the first word will be followed by a sequence of a pair of numbe

Multiple assign statements targeting the same wire, What logic is inferred ...

What logic is inferred when there are multiple assign statements targeting the same wire? It's illegal to specify multiple assign statements to the same wire in a synthesizable

Name the switching schemes used in a digital exchange, Name the switching s...

Name the switching schemes used in a digital exchange? The several switching systems used are:  1. Strowger Switching System 2. Cross bar Switching. 3. Electronic Swit

Line of code of assembly language, In how many ways line of code of assembl...

In how many ways line of code of assembly language can be divided? A line of code of an assembly language program can be divided in three columns called as fields. The fields d

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