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

What is reduction, What is reduction?  A reduction is a way of changing...

What is reduction?  A reduction is a way of changing one problem into another in such a way that a solution to the second problem can be used to explain the first problem.

Write examples of declarations of external variables, Examples of declarati...

Examples of declarations of external variables  that  are  not definitions: extern char stack[10]; extern int stkptr; These declarations tell the compiler that the variab

What is dispatch unit, What is dispatch unit? A separate unit which we ...

What is dispatch unit? A separate unit which we call the dispatch unit fetch instructions from the front of the queue and sends them to the execution unit. The dispatch unit al

Components of a 3-tier client server, What are the essential components of ...

What are the essential components of a 3-tier client server In a three-tier or multi-tier environment, the client executes the presentation logic (the client). The business log

Processes vs threads, One might argue that in general processes are more ?e...

One might argue that in general processes are more ?exible than threads. For one thing, they can live in two different machines, and communicate via sockets; they are easy to spawn

Affective functioning - integrated test result, Mr. X's MMPI suggests that ...

Mr. X's MMPI suggests that he either suppresses anger and hostility or has a naturally low level of anger and hostility (O-H=58, ANG=36, TPA=41, AGGR=36). His responses on the PAS

What are the characteristics of dram, What are the characteristics of DRAM?...

What are the characteristics of DRAM? Low cost High density Refresh circuitry is needed

Colour management, There are three primary colours in pigments - Red, Yello...

There are three primary colours in pigments - Red, Yellow and Blue. There are two ways to produce more colours:   Physical Mixing: Physically mix colours to produce a new colour

Virtulization, Analyse the future of Operating Systems with reference to Vi...

Analyse the future of Operating Systems with reference to Virtualisation.words accepted#

Ethernet 10 base 2 is an example of which topology, Ethernet 10 Base 2 is a...

Ethernet 10 Base 2 is an example of               network topology. (A)  Bus                                           (B)  Ring (C)  Star

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