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

How can we set the table spaces and extent sizes, How can we set the table ...

How can we set the table spaces and extent sizes? You can state the extent sizes and the table space (physical storage area in the database) in which a transparent table is to

What is perl, Perl is an interpreted language (not compiled, like Java) whi...

Perl is an interpreted language (not compiled, like Java) which is ideally suited for CGI programming. It has its roots in UNIX system administration and offers various features li

Documentation introduction, Documentation is done to give others with infor...

Documentation is done to give others with information and ease maintenance. The best documentation is done in the headers (function and scripts) and directly in the code. Any usefu

Explain a full subtractor using half subtractors, Draw the logic diagram of...

Draw the logic diagram of a full subtractor using half subtractors and explain its working with the help of a truth table Ans: Full Subtractor: It has to take care of repe

Draw a schematic for managing dynamic storage allocation, Draw a simple sch...

Draw a simple schematic for managing dynamic storage allocation. A simple schematic for managing dynamic storage allocation is as follows: Block size pointe

Explain how the server control validation controls work, Briefly explain ho...

Briefly explain how the server control validation controls work? A validation control works by evaluating the value of an input server control on the page to see whether it me

How to changing the directory in dos, Q. How to Changing the Directory in D...

Q. How to Changing the Directory in DOS? You can change the directory. After changing the directory, the new directory becomes the default directory. For example, you change th

Features of hyper-threading, The salient features of hyper threading are: ...

The salient features of hyper threading are: i)  Improved support for multi-threaded code, permitting multiple threads to run concurrently. ii) Response time and improved rea

An example of two stages network have switching elements, For two stages ne...

For two stages network the switching elements for M inlets with r blocks and N outlets with s blocks is given by (A) Ms + Nr                                (B)  Mr + Ns (

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