How can a function return a pointer to its calling routine, Computer Engineering

Assignment Help:

How can a function return a pointer to its calling routine?

The general form of a function is:

type_specifier function_name(parameter list)

{

body of function;

}

where type_specifier specifies the type of value that the function's return statement returns and the parameter list is a comma-separated list of variable names and types which receive the values of the arguments passed by the call to the function. The purpose of most functions is to either perform a computation and return a value, manipulate information and return a success-or-failure (true or false) value, or perform a strictly procedural routine which produces no value (eg, the exit() function). Functions may be declared to return any valid C data type. If the  return  type  is  not  specified,  it  automatically  defaults  to  type  int.  return  causes  an immediate exit from a function. It may also be used to return a value. All functions, except those of type void, return a value.

Functions that return pointers are handled just like any other type of function, e.g.:

char * match(char c, char *s)

{

while(c != *s && *s)

s++;

return(s);


Related Discussions:- How can a function return a pointer to its calling routine

Transfer data among computers on the internet, Tool that is used to transfe...

Tool that is used to transfer data/files among computers on the Internet TCP (Transfer control protocol)

State about the object models, State about the Object models Object mo...

State about the Object models Object models are used for explaining the objects in the system and their connection with each other in the system. The dynamic model explains in

Define the advantages of assembly language., Highlight the advantages of as...

Highlight the advantages of assembly language. The benefits of assembly language program would be Reduced errors Faster translation times Changes could be made fas

Explain activities of an operating system, List the major activities of an ...

List the major activities of an operating system with respect to memory management, secondary storage management and process management. Operating system is causes for followin

Fundamentals of systems, System is a word which is derived from the Greek w...

System is a word which is derived from the Greek word 'Systema' which means an organized relationship among components. A System can be defined as orderly grouping of interdepen

What are the input devices, What are the Input devices Various devices ...

What are the Input devices Various devices are available for data input on graphics workstations. Most systems have a keyboard and one or more additional devices specially desi

Object orientation and uml, In this task you are supposed to create three U...

In this task you are supposed to create three UML diagrams. The conditions are given by the scenario in the document Theatre Case (on Blackboard). A theatre manager has ordered a s

Cloud computing, what is the scope of doing a final year project on cloud c...

what is the scope of doing a final year project on cloud computing?

Different industries which use this marketing tool, What are the different ...

What are the different industries which use this marketing tool? Ans) Many dissimilar companies can use this tool for developing their business plan but it is often three main

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